/* 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
	{
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long k = sc.nextLong();
		//long[] arr = new long[(int)n];
		long count=0, prev=0;
		for(int i=0; i<(int)n; i++)
		{
		    long ek = sc.nextLong();
		    count+=(ek+prev)/k;
		    prev = (ek+prev)%k;
		}
		if(prev>0)
		count++;
		System.out.println(count);
	}
}
