#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-13;
const long double PI = acos(-1);
const int INF = (int)1e9;
const long long INFF = (long long)1e18;
const int mod = (int)1e9 + 7;
const int MXN = (int)2e5 + 7;
int a[MXN];
int main(void) {
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i = 1; i < n + 1; i++) scanf("%d", a + i);
  long long ans = 0, cur = 0;
  for (int i = 1; i < n + 1; i++) {
    if (!cur) {
      cur = a[i];
      continue;
    }
    if (cur % k == 0) {
      ans += cur / k;
      cur = a[i];
      continue;
    }
    int v = k - cur % k;
    if (v >= a[i]) {
      ans += (cur + v) / k;
      cur = 0;
    } else {
      ans += (cur + v) / k;
      cur = a[i] - v;
    }
  }
  if (cur) ans += (cur + k - 1) / k;
  printf("%lld\n", ans);
  return 0;
}
