#include <iostream>
using namespace std;
int n,k;
int main(){
cin >> n >> k;
int m = k,res = 0;
for(int i = 0;i < n;i++){
int x;
cin >> x;
m -= x;
if(m <= 0){
res ++;
m = k;
}
}
if(m && m != k) res++;
cout << res << endl;
return 0;
}