//package dec18;

import java.util.Scanner;

public class GarbageDisposal {
	public static void main(String[] args) {
		Scanner scn=new Scanner(System.in);
		int n=scn.nextInt();
		long k =scn.nextLong();
		long[] arr=new long[n];
		for(int i = 0 ; i<n; i++)
		{
			arr[i]=scn.nextLong();
		}
		long bagcount=0;
		long r = 0;
		long q =1;
		long[] cnt=new long[n];
		for(int i=0; i<n; i++)
		{
			
			q = (arr[i]+r)/k;
			
			bagcount=bagcount+q;
			r = (arr[i]+r)%k;
			if(r!=0)
			{
				cnt[(int) q]+=1;
			}
			
			
		}
		if(r!=0)
		{
		System.out.println(bagcount+1);
		}
		else
		{
			System.out.println(bagcount+cnt[0]-1);
		}
	}

}
