import java.util.*;
import java.lang.Math;
public class Main{
    public static void main (String[] args){
        Scanner scan = new Scanner(System.in);
        long n = scan.nextInt();
        long k = scan.nextInt();
        long toDisp = 0;
        long now = 0;
        for (long i = 0; i < n; i++){
            long cur = scan.nextInt();
            long total = cur + now;
            if (now == 0){
                toDisp += total / k;
                now = total % k;
                continue;
            }
            long toThrow = 0;
            if (total < k){
                toThrow = 1;
                now = 0;
            }
            else{
                toThrow = total / k;
                now = total %k;
            }
            toDisp += toThrow;
        }
        if (now != 0)
            toDisp++;
        System.out.println(toDisp);
    }
}
