#include <bits/stdc++.h>
using namespace std;
int n, m;
long long a[20005];
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;
    ans += a[i] / m;
    to = a[i] % m;
    if (to + yest >= m) {
      ans++;
      if (yest >= m)
        yest -= m;
      else {
        to -= m - yest;
        yest = 0;
      }
    }
    if (yest > 0) ans++;
  }
  if (to > 0) ans++;
  cout << ans << endl;
  return 0;
}
