#include <bits/stdc++.h>
const int maxN = 2e5 + 100;
int n, k;
int a[maxN];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  long long ans = 0, res = a[1];
  for (int i = 2; i <= n + 1; ++i) {
    bool flag = 0;
    if (res) flag = 1;
    res += a[i];
    if (res == 0) continue;
    if (flag && res <= k) {
      ans++;
      res = 0;
    } else {
      ans += res / k;
      res %= k;
    }
  }
  printf("%lld\n", ans);
}
