#include <bits/stdc++.h>
#pragma GCC optimize(3)
using namespace std;
const long long llINF = 9223372036854775807;
const int INF = 2147483647;
const int maxn = 2e5 + 7;
const int maxm = 2e5 + 7;
const int mod = 998244353;
int n, k;
long long a[maxn];
long long ans;
int main(int argc, char const *argv[]) {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  int p = 1;
  while (p <= n) {
    long long tmp = a[p] + a[p + 1];
    if (p + 1 == n) {
      if (tmp % k)
        ans += (tmp / k + 1);
      else
        ans += tmp / k;
      break;
    }
    if (tmp < k) {
      ans++;
      a[p + 1] = 0;
    } else {
      int num = tmp / k;
      if (num * k < a[p]) {
        ans += num + 1;
        a[p + 1] = max(tmp - k * num + k, 1ll * 0);
      } else {
        ans += num;
        a[p + 1] = tmp % k;
      }
    }
    if (a[p + 1] == 0)
      p = p + 2;
    else
      p = p + 1;
  }
  printf("%lld\n", ans);
  return 0;
}
