#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];
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];
    if (i == n) {
      ans += (sum / k + (sum % k == 0 ? 0 : 1));
    } else {
      if (res > 0 && sum / k == 0) {
        ans++;
        res = 0;
      } else {
        ans += sum / k;
        res = sum % k;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
