#include <bits/stdc++.h>
long long int n, k, sum;
long long int a[1000000];
int main() {
  while (~scanf("%lld %lld", &n, &k)) {
    sum = 0;
    for (int i = 0; i < n; i++) {
      scanf("%lld", &a[i]);
    }
    for (int j = 0; j < n - 1; j++) {
      if (a[j] >= k) {
        if (a[j] % k == 0) {
          sum += a[j] / k;
        }
        if (a[j] % k != 0) {
          sum += a[j] / k;
          a[j + 1] += (a[j] - ((a[j] / k) * k));
        }
      }
      if (a[j] < k) {
        a[j + 1] += a[j];
      }
    }
    if (a[n - 1] % k == 0) {
      sum += a[n - 1] / k;
    } else {
      sum += (a[n - 1] / k) + 1;
    }
    printf("%lld\n", sum);
  }
  return 0;
}
