#include <bits/stdc++.h>
using namespace std;
long long a[200010], b[200010];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    ans += (a[i] + b[i]) / k;
    int tmp = (a[i] + b[i]) % k;
    if (tmp <= a[i]) {
      b[i + 1] += tmp;
    } else {
      ans++;
    }
  }
  if (b[n] != 0)
    cout << ans + (b[n] - 1) / k + 1 << endl;
  else
    cout << ans << endl;
  return 0;
}
