#include <bits/stdc++.h>
const int dx[] = {0, -1, 0, 1, 0, -1, -1, 1, 1};
const int dy[] = {0, 0, 1, 0, -1, -1, 1, 1, -1};
const int N = 2e5 + 7;
const int mod = 998244353;
const int base = 131;
using namespace std;
long long n, k, a[N];
inline long long read() {
  char c = getchar();
  long long ans = 0, f = 1;
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    ans = ans * 10 + c - '0';
    c = getchar();
  }
  return ans * f;
}
inline void write(long long x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
int main() {
  n = read(), k = read();
  for (int i = 1; i <= n; ++i) a[i] = read();
  long long left = 0, ans = 0;
  for (int i = 1; i <= n + 1; ++i) {
    if (left > 0 && a[i] <= k - left) {
      ans++;
      left = 0;
      continue;
    }
    if (left > 0 && a[i] > k - left) a[i] -= (k - left), ans++;
    ans += a[i] / k, left = a[i] % k;
  }
  write(ans), puts("");
  return 0;
}
