#include <bits/stdc++.h>
using namespace std;
long long N, K, a[500000], ans;
int main() {
  cin >> N >> K;
  for (int i = 1; i <= N; i++) {
    cin >> a[i];
    a[i] += a[i - 1];
    if (a[i] <= K && a[i - 1] > 0) {
      ans += 1;
      a[i] = 0;
    } else {
      ans += a[i] / K;
      a[i] = a[i] % K;
    }
  }
  if (a[N] != 0) {
    ans += 1;
  }
  cout << ans << endl;
  return 0;
}
