#include <bits/stdc++.h>
using namespace std;
int a[200005];
int read() {
  int res = 0;
  char ch = getchar();
  while (ch > '9' || ch < '0') ch = getchar();
  while (ch >= '0' && ch <= '9')
    res = (res << 3) + (res << 1) + (ch ^ '0'), ch = getchar();
  return res;
}
void print(long long x) {
  if (x > 9) print(x / 10);
  putchar(x % 10 + '0');
}
int main() {
  long long ans = 0;
  int n = read(), k = read(), x = 0, y = 0;
  for (int i = 1; i <= n; ++i) {
    y = a[i] = read();
    int t = 0;
    if (x) {
      ++ans;
      y -= (k - x);
      if (y < 0) y = 0;
      ans += y / k;
      x = y % k;
      if (i == n && x) ++ans;
      continue;
    }
    ans += y / k;
    x = y % k;
    if (i == n && x) ++ans;
  }
  print(ans);
  return 0;
}
