#include <bits/stdc++.h>
using namespace std;
long long n, k;
long long a[200002];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  a[n] = 0;
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i - 1] % k == 0)
      ans += a[i - 1] / k;
    else {
      long long need = a[i - 1] / k + 1;
      ans += need;
      a[i] = max(0LL, a[i] + a[i - 1] - need * k);
    }
  }
  cout << ans << '\n';
  return 0;
}
