

import java.util.Scanner;
public class Main{
    public static void main(String[] args) {
        Scanner get=new Scanner(System.in);
        long n,k;
        n=get.nextInt();
        k=get.nextInt();
        long count=0;
        int n1=(int)n+100;
        int a[]=new int[n1];
        a[0]=get.nextInt();
        if(a[0]>=k){
           count=count+a[0]/k;
           a[0]=a[0]%(int)k;
        }
        int sum=0;
        for(int i=1;i<n;i++){
            a[i]=get.nextInt();
            sum=a[i-1]+a[i];
            if(sum<k && a[i-1]>0){
                count=count+1;
            }
            else if(sum>=k){
                count=count+sum/k;
                a[i]=sum%(int)k;
                if(i+1==n && a[i]>0){
                    count=count+1;
                }
            }
        }
        System.out.println(count);
    }
}
