import java.util.Scanner;

public class asd2 {
    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 bagsCount = 0;
        for (int i = 0; i < days.length; i++) {
            days[i] = in.nextLong();
            sum += days[i];
            if (days[i] == 0 && i != 0 && i!=days.length-1) {
                bagsCount++;
            }
        }
        if((long) Math.ceil(sum / bagValue) + bagsCount < (long)(sum / bagValue) + bagsCount){
            System.out.println((long) Math.ceil(sum / bagValue) + bagsCount + 1);
        }
        else {
            System.out.println((long) Math.ceil(sum / bagValue) + bagsCount);
        }

    }
}