import java.util.Scanner;

public class Main {
    public static void main(String[] args)
    {
        Scanner scan=new Scanner(System.in);
        long n=scan.nextInt();
        long k=scan.nextInt();
        long  bags=0;
        long prevDay=0;
        long thisDay;
        long thisDayBags;
        for(long i=0;i<n;i++) {
            thisDay=(scan.nextInt() + prevDay);
            thisDayBags = thisDay / k;
            
            if(thisDay<k&&prevDay!=0){
                thisDayBags++;
                thisDay-=prevDay;
            }
            if(thisDay-thisDayBags*k>0)
            prevDay=thisDay%k;
            else prevDay=0;
            bags+=thisDayBags;

        }
        if(prevDay!=0)bags++;
        System.out.println(bags);
    }
}