import java.util.Scanner;

public class miaomiao {
    public static void main(String[] args) {
        long n,c;
        long count =0;
        long left=0;
        Scanner in = new Scanner(System.in);
        n=in.nextLong();
        c=in.nextLong();
        int flag=0;
        for(long i=0;i<n;i++){
            left+=in.nextLong();
            if(left<c&&flag==1){
                left=0;
                count++;
                flag=0;
            }
            else if(left>=c){
                count+=left/c;
                left=left%c;
                if(left!=0)
                    flag=1;
                else
                    flag=0;
            }
            else{
                if(left!=0)
                    flag=1;
            }
        }
        if(flag==1)
            count++;
        System.out.println(count);
    }
}
