#include <bits/stdc++.h>
using namespace std;
const int maxN = 2e5 + 10;
int n;
long long k, a[maxN];
int main() {
  cin >> n >> k;
  int sav = 0;
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (sav && a[i] + sav < k) {
      ans++;
      sav = 0;
      continue;
    }
    ans += (a[i] + sav) / k;
    sav = (a[i] + sav) % k;
  }
  if (sav) ans++;
  cout << ans;
  return 0;
}
