 

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;
        for(int i=0;i<n;i++){
            a[i]+=add;
            bags+=(a[i])/k;
            add=a[i]%k;
        }
        if(add>0)bags++;
        out.write(String.valueOf(bags));
        out.flush();

    }


}
