#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
long long a[maxn], n, k;
int main() {
  while (~scanf("%lld%lld", &n, &k)) {
    int r = 0;
    for (int i = 1; i <= n; ++i) {
      scanf("%lld", a + i);
    }
    long long ans = 0;
    for (int i = 1; i <= n; ++i) {
      int tmp = (a[i] + r) / k * k;
      ans += (a[i] + r) / k;
      if (tmp >= r) {
        r = (a[i] + r) % k;
      } else {
        ans++;
        r = 0;
      }
    }
    printf("%lld\n", ans + (r > 0));
  }
  return 0;
}
