

import java.io.*;

public class competetive {

    public static void main(String[] args) throws java.lang.Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(java.io.FileDescriptor.out), "ASCII"), 512);
        String input=br.readLine();
        String[] in=input.trim().split(" ");
        int n=Integer.parseInt(in[0]);
        long k=Long.parseLong(in[1]);
        String line=br.readLine();
        String[] s=line.trim().split(" ");
        long[] a=new long[n];
        for(int i=0;i<n;i++){
            a[i]=Long.parseLong(s[i]);
        }
        long bags=0;
        long add=0;
        int j=0;
        int c=0;
        while(j<n){
            if(a[j]+add<=k){
                c++;
                if(c==2){
                    bags++;
                    c=0;
                    add=0;
                }else{
                    add=a[j];
                }
            }else{
                bags+=(a[j]+add)/k;
                add=(a[j]+add)%k;
                c=1;
            }
            j++;
        }
        if(add>0)bags++;
        out.write(String.valueOf(bags));
        out.flush();

    }


}
