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

public class GarbageDisposal {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		long ans = 0;
		int n = sc.nextInt();
		int k = sc.nextInt();
		int prev = 0;
		for (int i = 0; i < n; i++) {
			int x = sc.nextInt() + prev;
			int inc = x / k;
			if (inc == 0 && prev > 0) {
				ans++;
				prev = 0;
			} else {
				ans += inc;
				prev = x % k;
			}
		}
		if (prev > 0)
			ans++;
		pw.println(ans);
		pw.close();
	}

	static class Scanner {
		BufferedReader br;
		StringTokenizer st;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public Scanner(FileReader f) {
			br = new BufferedReader(f);
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public int[] nextIntArr(int n) throws IOException {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++) {
				arr[i] = Integer.parseInt(next());
			}
			return arr;
		}

	}

}
