



import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import javafx.util.Pair;

public  class CodeForce {
static	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
static StringBuilder sb = new StringBuilder();

	static boolean flag = false;
	 
	static int next(String [] sr,int ind)
	{
		return Integer.parseInt(sr[ind]);
	}

	public static void main(String[] args) throws IOException {
		
String[] sr=br.readLine().split(" ");


int n=next(sr,0);
int k=next(sr,1);

sr=br.readLine().split(" ");
int[] arr=new int[n];
for(int i=0;i<n;i++)
{
	arr[i]=next(sr,i);
}


long res=0;
long count=0;
if(n==1)
{System.out.println((long)Math.ceil((double)arr[0]/(double)k));
return;
	}
if(arr[0]<k)
	res=arr[0];
else
{
	res=arr[0]%k;
	count+=arr[0]/k;


}
for(int i=1;i<n-1;i++)
{if(res==0)
{count+=arr[i]/k;
res=arr[i]%k;
	}
else
{
	if(arr[i]+res<k)
		{count++;res=0;}
	else
		{count+=(arr[i]+res)/k;
	    res=(arr[i]+res)%k;}
	}
}
count+=(long)Math.ceil((double)(res+arr[n-1])/(double)k);
System.out.println(count);
	
}



}
