import java.io.*;
import java.util.*;
import java.util.regex.*;
public class vk18
{
    public static void main(String[]stp) throws Exception
    {
    	Scanner scan=new Scanner(System.in);
    	PrintWriter pw = new PrintWriter(System.out);
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer(br.readLine());
        //String []s;
        int n=Integer.parseInt(st.nextToken()),i,k=Integer.parseInt(st.nextToken());
        long count=0,prev=0;
        st=new StringTokenizer(br.readLine());
        Integer a[]=new Integer[n];
        for(i=0;i<n;i++) a[i]=Integer.parseInt(st.nextToken());
        for(i=0;i<n;i++)
        {
        	if((prev+a[i])/k ==0 && prev > 0) { prev=0; count++; }
        	else
        	{
        		count+=(prev+a[i])/k;
        		prev=(prev+a[i])%k;
        	}
        }
        if(prev > 0) count++;
        pw.println(count);
        pw.flush();
    }
	
}