import java.io.*;
public class trash
{
	public static void main(String args[]) throws Exception
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String a[]=br.readLine().split(" ");
		int n=Integer.parseInt(a[0]);
		int k=Integer.parseInt(a[1]);
		String a1[]=br.readLine().split(" ");
		int ai[]=new int[n];
		long bag=0;
		for(int i=0;i<n;i++)
		{
			int tmp=Integer.parseInt(a1[i]);
			ai[i]=tmp;
		}
		for(int i=0;i<n-1;i++)
		{
			int sum=ai[i]+ai[i+1];
			if(sum>=k)
			{
				bag+=sum/k;
				ai[i+1]=sum%k;
			}
			else
			{
				//bag+=sum/k;
				bag+=1;
				ai[i+1]=0;
			}


		}
		if(ai[n-1]!=0)
		{
			bag+=ai[n-1]/k;
			if(ai[n-1]%k!=0)
				bag+=1;
		}
		System.out.println(bag);
		/*
		int check=ai[0];
		int ex=0;
		for(int i=0;i<n;i++)
		{
			bag+=(ai[i]/k);
			if(ai[i]%k==0)
			{
				check=ai[i];
				ex=0;
				continue;
			}
			else
			{
				int x=ai[i]%k;
				//System.out.println(k);
				if(ex<=check && i!=n-1)
				{
					check=ai[i+1];
					ai[i+1]+=x;
					ex=x;
				}
				else
					bag+=1;

			}
			//System.out.println(bag);	
		}
		System.out.println(bag);
		//System.out.println(ai[0]+" "+ai[1]+" "+ai[2]+" "+ai[3]+" "+ai[4]);
		*/
		br.close();
	}
}