#include <bits/stdc++.h>
int main() {
  long long k, a, b = 0, sum = 0;
  int n;
  scanf("%d%lld", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &a);
    if (a + b < k && b != 0) {
      sum++;
      b = 0;
    } else {
      sum += (a + b) / k;
      b = (a + b) % k;
    }
  }
  if (b != 0) sum++;
  printf("%lld\n", sum);
  return 0;
}
