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