import java.util.*;

public class main{

	static long mod = (long)1e9+7;
	static int max = (int)1e5+5;
	
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		long ans = 0,prev = 0;
		int n = in.nextInt(), k = in.nextInt();
		for(int i=0;i<n;i++){
			long x = in.nextInt();
			if(prev==0){
				if(x>=k){
					int y = (int)Math.ceil((1.0*x)/k);
					ans += y;
					prev = (y*k-x);
				}
				else if(x>0){
					ans += 1;
					prev = k-x;
				}
			}
			else{
				if(x<=prev){
					prev = 0;
				}
				else{
					x -= prev;
					prev = 0;
					if(x>=k){
						int y = (int)Math.ceil((1.0*x)/k);
						ans += y;
						prev = (y*k-x);
					}
					else{
						ans += 1;
						prev = k-x;
					}
				}
			}
		}
		// if(prev>0)
		// 	ans += (long)Math.ceil((1.0*prev)/k);
		System.out.println(ans);
	}	
}