import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int m = sc.nextInt();
int n = sc.nextInt();
int classes[] = new int[m];
int remain = n;
int needCarNums = 1;
for (int i = 0; i < m; i++) {
classes[i] = sc.nextInt();
if (classes[i] > remain) {
remain = n;
needCarNums++;
}
remain -= classes[i];
}
System.out.println(needCarNums);
}
}