//package codeforces.CPC_NEERC_2018_2019;

import java.util.Scanner;

public class D {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        int[] garbazes = new int[n];
        for (int i = 0; i < n; i++) {
            garbazes[i] = scanner.nextInt();
        }
        long totalBags = 0;
        for (int i = n - 1; i > 0; i--) {
            totalBags += garbazes[i] / k;
            int remaining = garbazes[i] % k;
            if (remaining != 0) {
                totalBags++;
                garbazes[i - 1] = Math.max(0, garbazes[i - 1] - (k-remaining));
            }
        }
        totalBags += garbazes[0] / k;
        if (garbazes[0] % k != 0) totalBags++;
        System.out.println(totalBags);

    }
}
