import java.util.*;
import java.math.*;
import java.io.*;

public class q_8 {

    public static void main(String[] args){

        Scanner sc = new Scanner(System.in);
        PrintWriter pr = new PrintWriter(System.out);
        long n = sc.nextInt();
        long cap = sc.nextInt();
        long res = 0;
        long this_day= 0;
        long prev_day = sc.nextInt();
        if(n==1){
            System.out.println((int)(Math.ceil((prev_day)/(double)cap)));
            return;
        }
        for(long i=1 ; i<n-1 ; i++){
            this_day = sc.nextInt();
            long v=((this_day+prev_day)/cap);
            res+=v;
            if(v*cap>=prev_day){
                // do nothing
                prev_day = this_day+prev_day -(v*cap);
                this_day = 0;
            }
            else {
                res++;
                prev_day = this_day;
                this_day = 0;
            }
        }
        res+=(Math.ceil((sc.nextInt()+prev_day)/(double)cap));
        System.out.println(res);
    }

}
