import java.util.Scanner;

public class D1070 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        int K = in.nextInt();
        long bags = 0;
        int fromPrevious = 0;
        for (int n=0; n<N; n++) {
            int a = in.nextInt();
            if (fromPrevious > 0) {
                int toPrevious = Math.min(K-fromPrevious, a);
                a -= toPrevious;
                bags++;
            }
            bags += a/K;
            fromPrevious = a%K;
        }
        if (fromPrevious > 0) {
            bags++;
        }
        System.out.println(bags);
    }

}
