import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        int n = in.nextInt();
        int k = in.nextInt();

        int count = 0;
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = in.nextInt();
            if (array[i] != 0)
                count++;

        }
        long sum = 0;

        for (int i = 0; i < n; i++) {
            sum += array[i];
        }

        if (k == 1) {
            System.out.println(sum);
        } else {
            sum = 0;
            int o = 0;
            for (int i = 0; i < array.length - 1; i++) {
                if (o != 0)
                    array[i] += o;
                if (array[i + 1] != 0) {
                    sum += array[i] / k;
                    o = array[i] % k;
                } else {
                    sum += Math.ceil(array[i] / (float) k);
                }
            }
            array[n -1] += o;
            sum += Math.ceil(array[n - 1] / (float) k);

            System.out.println(sum);
        }
    }
}
