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