#include <bits/stdc++.h>
int main() {
  long long int m, n, k, a[200005], sum = 0;
  scanf("%lld%lld", &n, &k);
  for (m = 0; m < n; m++) scanf("%lld", &a[m]);
  for (m = 0; m < n; m++) {
    a[m + 1] = a[m] + a[m + 1];
    if (a[m + 1] <= k && m < n - 1) {
      sum += 1;
      m++;
    }
    if (a[m + 1] > k && m < n - 1) {
      sum += a[m + 1] / k;
      a[m + 1] = a[m + 1] % k;
    }
    if (m == n - 1) {
      if (a[m] % k == 0)
        sum += a[m] / k;
      else
        sum += a[m] / k + 1;
    }
  }
  printf("%lld", sum);
  return 0;
}
