#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n, k, bal;
  int i, j;
  cin >> n >> k;
  vector<long long> a(n);
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long ans = 0;
  bal = 0;
  for (i = 0; i < n; i++) {
    if (bal + a[i] < k && bal > 0) {
      ans++;
      bal = 0;
    } else if (bal + a[i] >= k) {
      ans += (bal + a[i]) / k;
      bal = (bal + a[i]) % k;
    } else {
      bal = a[i];
    }
  }
  if (bal > 0) {
    ans++;
  }
  cout << ans << endl;
  return 0;
}
