import java.util.Scanner;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
        Scanner reader = new Scanner(System.in);
        int n = reader.nextInt();
        int k = reader.nextInt();
        int[] garbage = new int[n];
        long sum = 0,bags = 0;
        for (int i = 0; i < n ; i++)
        {
            garbage[i] = reader.nextInt();
            sum += garbage[i];
            if(garbage[i] == 0)
            {
                if(sum % k != 0)
                    bags++;
            }
        }
        bags += sum / k;
        if(sum % k == 0)
            System.out.println(bags);
        else
            System.out.println(bags + 1);
    }
}


