#include <bits/stdc++.h>
using namespace std;
int n, m;
long long a[200005];
long long ans = 0;
long long yest = 0, to = 0;
int main() {
  int i, j;
  cin >> n >> m;
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n; i++) {
    yest = to;
    to = a[i];
    if (yest > 0) {
      if (to >= m - yest) {
        to -= m - yest;
        yest = 0;
      } else
        to = yest = 0;
      ans++;
    }
    ans += to / m;
    to %= m;
    if (yest > 0) ans++;
  }
  if (to > 0) ans++;
  cout << ans << endl;
  return 0;
}
