#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n, m;
  scanf("%lld%lld", &n, &m);
  long long a = 0, b = 0, ans = 0;
  for (long long i = 1; i <= n; i++) {
    long long x;
    scanf("%lld", &x);
    x += a;
    if (x < m) {
      if (a) ans++, x = 0;
    } else {
      ans += x / m;
      x %= m;
    }
    a = x;
  }
  printf("%lld\n", ans + !!a);
  return 0;
}
