#include <bits/stdc++.h>
using namespace std;
long long gn() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || '9' < ch) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return f * x;
}
int n;
long long k;
int main() {
  n = gn();
  k = gn();
  long long s = 0ll;
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    long long x = gn();
    if (s) {
      s += x;
      ans++;
      s -= k;
      if (s < 0) s = 0;
    } else
      s += x;
    ans += s / k;
    s = s % k;
  }
  if (s) ans++;
  cout << ans << endl;
}
