import java.io.*;
import java.util.*;

public class GarbageDisposal {

	public static void main(String[] args) throws Exception{
		BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
		
		StringTokenizer st = new StringTokenizer(f.readLine());
		
		int n = Integer.parseInt(st.nextToken());
		int k = Integer.parseInt(st.nextToken());
		
		int[] a = new int[n];
		
		st = new StringTokenizer(f.readLine());
		for(int i = 0; i < n; i ++) {
			a[i] = Integer.parseInt(st.nextToken());
		}
		
		long ans = 0;
		for(int i = n-1; i >= 0 ; i --) {
			if(i == 0) {
				ans += (a[i] + k-1)/k;
				break;
			}
			
			if(i >0 && a[i] % k != 0 && a[i-1] >= k - (a[i] % k)) {
				a[i-1] -= k - (a[i] % k);
				ans += (a[i] + k - 1)/k;
			}
			else {
				if(a[i] > 0) {
					ans += Math.max(a[i]	/k, 1);
				}
			}
		}
		
		System.out.println(ans);
	}

}
