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