#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200005;
int main() {
  int n, k;
  long long ans = 0;
  scanf("%d%d", &n, &k);
  for (int i = 0, r = 0, x; i < n; ++i) {
    scanf("%d", &x);
    if (r > 0 && x + r <= k)
      ++ans, r = 0;
    else
      ans += (x + r) / k, r = (x + r) % k;
    if (i == n - 1 && r > 0) ++ans;
  }
  printf("%lld\n", ans);
  return 0;
}
