#include <bits/stdc++.h>
using namespace std;
long long n, k, a[200005], ans = 0, temp = 0;
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  temp = a[1] % k;
  ans += a[1] / k;
  for (int i = 2; i <= n; i++) {
    if (a[i] + temp <= k)
      temp = 0, ans++;
    else {
      ans += (a[i] + temp) / k;
      temp = (a[i] + temp) % k;
    }
  }
  if (temp) ans++;
  cout << ans << "\n";
  return 0;
}
