import java.util.Scanner;
public class Cake {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int n = input.nextInt();
int limit = input.nextInt();
int[] arr = new int[n];
for (int i = 0; i < arr.length; i++) {
arr[i] = input.nextInt();
}
int count = 0;
int sum = 0;
for (int i = 0; i < arr.length; i++) {
sum+=arr[i];
if(sum >= limit){
count++;
sum = 0;
}
}
if(sum != 0){
count++;
}
System.out.println(count);
}
}