
import java.util.*;
public class Hyg {

	public static void main(String[] args) {
		Scanner obj = new Scanner(System.in) ;
		int n =obj.nextInt();
		long k =obj.nextLong();
		long a =obj.nextLong();
		long res =a/k;
		long o=a%k ;
		for(int i=1 ; i<n;i++)
		{
			a =obj.nextLong();
			a+=o;
			long h = a/k ;
			if(h==0) 
			{
				res++ ; o= 0 ;
			}
			else
			{
				res+=h;
				o=a%k ;
			}

		}
		if(o>0) res++ ;
		System.out.println(res);

	}

}
