import java.util.*;
public class GarbageDisposal {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int K = scanner.nextInt();
        int garbage[] = new int[N];
        for(int i = 0; i < N; i++) {
            garbage[i] = scanner.nextInt();
        }
        int prevGarb = 0;
        long totUsed = 0;
        for(int i = 0; i < N; i++) {
            int garb = garbage[i];
            if (prevGarb > 0 || (prevGarb + garb) >= K) {
                totUsed += (prevGarb+garb)/K;
                if ((prevGarb + garb) < K) {
                    prevGarb = (prevGarb + garb) % K;
                }
            }
            else {
                prevGarb = garb;
            }
        }
        if (prevGarb > 0) {
            if (prevGarb%K!=0) {
                totUsed++;
            }
            totUsed+=prevGarb/K;
        }
        System.out.println(totUsed);
    }
}
