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;
            long toThrow = (total < k && !(total == 0)) ? 1 : (total / k);
            now = (total < k) ? 0 : (total % k);
            toDisp += toThrow;
        }
        toDisp = (now == 0) ? toDisp : (toDisp + 1);
        System.out.println(toDisp);
    }
}
