#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
int n, k;
int a[N];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    int now = a[i - 1] + a[i];
    ans += now / k;
    now %= k;
    if (now > a[i] && i != n) {
      ans++;
      a[i] = a[i - 1] = 0;
    } else {
      a[i - 1] = 0;
      a[i] = now;
    }
    if (i == n && now) ans++;
  }
  printf("%I64d\n", ans);
  return 0;
}
