import java.util.*;

public class q {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int N = in.nextInt(), k = in.nextInt();
        long[] arr = new long[N];

        for (int j = 0; j < N; j++)
            arr[j] = in.nextInt();

        long ans = 0, prv = 0;
        for (int i = 0; i < N; i++) {

            if ((arr[i] + prv) < k && i != 0) {
                ans++;
                prv = 0;
                continue;
            }

            arr[i] += prv;
            ans += (arr[i]) / k;
            arr[i] = arr[i] % k;
            prv = arr[i];
        }

        if (prv != 0)
            ans++;

        System.out.println(ans);
    }

}