#include <bits/stdc++.h>
using namespace std;
int n, k, x;
long long ans, cur;
int main() {
  while (~scanf("%d %d", &n, &k)) {
    ans = 0;
    cur = 0;
    for (int i = 0; i < n; i++) {
      scanf("%d", &x);
      if (cur > 0) {
        cur += x;
        if (cur <= k) {
          ans++;
          cur = 0;
        } else {
          ans = ans + cur / k;
          cur %= k;
        }
      } else {
        cur += x;
        ans = ans + cur / k;
        cur %= k;
      }
    }
    if (cur) ans++;
    printf("%I64d\n", ans);
  }
  return 0;
}
