/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		Scanner z=new Scanner(System.in);
		int n=z.nextInt();
		long ar[]=new long[n];
		long k=z.nextLong();
		int i;
		long pre[]=new long[n];
		ar[0]=z.nextLong();
		pre[0]=0;
		for(i=1;i<n;i++)
		{
		    ar[i]=z.nextLong();
		    pre[i]=ar[i-1];
		}long j;long bag=0;
		for(i=0;i<n-1;i++)
		{
		    j=(long)Math.ceil((pre[i]*1.0)/k);
		   long d=(j*k)-pre[i];
		   if((pre[i+1]-d)>=0)pre[i+1]=pre[i+1]-d;
		   else pre[i+1]=0;
		   bag=bag+j;
		}
		j=(long)Math.ceil(((ar[n-1]+pre[n-1])*1.0)/k);
		bag=bag+j;
		System.out.println(bag);
	}
}
