#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<math.h>
#include<sstream>
using namespace std;
#define L 101
#define MAX 0x3f
int n,m,x;
int a[L];
int ans=1,t;
bool comp(int a,int b){
return a>b; //降序排列
}
int main()
{
cin >> n >> m;
t=m; //备份
for(int i=1;i<=n;i++){
cin >> x;
if(t-x>=0) t-=x;
else{t=m-x;ans++;}
}
cout << ans;
return 0;
}
/*
5 6
4 2 4 5 1
*/
//cout << "输入:"
结果: