import java.util.Scanner;

public class Main {
    public static void main(String[] args)
    {
        Scanner scan=new Scanner(System.in);
        int n=scan.nextInt();
        int k=scan.nextInt();
        int bags=0;
        int prevDay=0;
        int thisDay;
        for(int i=0;i<n;i++) {
            thisDay=(scan.nextInt() + prevDay);
            bags += thisDay / k;
            prevDay=thisDay%k;
        }
        if(prevDay!=0)bags++;
        System.out.println(bags);
    }
}
