#include <bits/stdc++.h>
using namespace std;
inline long long gcd(long long a, long long b) {
  return b > 0 ? gcd(b, a % b) : a;
}
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') {
      f = -1;
    }
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = 10 * x + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const long long maxnum = 1000005;
long long a[maxnum];
long long p[maxnum];
long long need[maxnum];
signed main() {
  long long n = read(), k = read();
  for (long long i = 1; i <= n; i++) a[i] = read();
  long long res = 0;
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    long long sum = res + a[i];
    long long need = sum / k;
    if (res > 0 && need == 0) {
      ans++;
      res = 0;
    } else {
      ans += need;
      res = sum - k * need;
    }
  }
  if (res) ans++;
  cout << ans << endl;
  return 0;
}
