#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long f = 1, sum = 0;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    sum = sum * 10 + c - '0';
    c = getchar();
  }
  return sum * f;
}
const int MAXN = 200010;
long long a[MAXN];
int main() {
  long long n = read(), k = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  long long last = 0;
  long long ans = 0;
  for (int i = 1; i < n; i++) {
    long long used = (a[i] + last) / k;
    if (last && !used) used = 1;
    a[i] += last;
    a[i] -= used * k, a[i] = max(a[i], 0ll), ans += used;
    last = a[i];
  }
  ans += ceil(1.0 * (a[n] + last) / k);
  cout << ans;
  return 0;
}
