import java.util.Scanner;

public class jskdfsfskjsd {


    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long dayCount = in.nextLong();
        long bagValue = in.nextLong();
        long[] days = new long[(int) dayCount];
        double sum = 0;
        long bagCount = 0;
        for (int i = 0; i < days.length-1; i++) {
            days[i] = in.nextLong();
            sum += days[i];
            if (days[i] == 0 &&( i!=0 || days[i+1]!=0)) {
                bagCount++;
            }

        }

        System.out.println((long) Math.ceil((sum / bagValue)+bagCount));

    }
}