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