import java.util.*;

public class garbagedisposal {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		int[] trash = new int[n];
		for (int i = 0; i < n; i++) {
			trash[i] = sc.nextInt();
		}
		long total = 0;
		int yesterday = 0;
		if (k > 1) {
			for (int i = 0; i < n; i++) {
				long trashForDay = 0;
				if (yesterday <= trash[i]) {
					trash[i] -= yesterday;
					trashForDay = trash[i] / k;
					if (trash[i] % k == 0) {
						yesterday = 0;
					}
					else {
						yesterday = k - (trash[i] % k);
					}
					if (yesterday != 0) {
						trashForDay++;
					}
				}
				else {
					yesterday = 0;
				}
				total += trashForDay;
			}
		}
		else {
			for (int i = 0; i < n; i++) {
				total += trash[i];
			}
		}
		System.out.println(total);
	}

}
