#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t = 1;
  while (t--) {
    long long int n, sum = 0, ct = 0, m, l, r, k, ans = 0;
    cin >> n >> k;
    long long int a[n];
    for (long long int i = 0; i < n; i++) cin >> a[i];
    long long int left = 0;
    for (long long int i = 0; i < n; i++) {
      left += a[i];
      if (left / k == 0)
        ct++;
      else
        ct = 0;
      if (ct == 2) {
        ans++;
        continue;
      }
      ans += (left / k);
      left %= k;
    }
    if (left) ans++;
    cout << ans << '\n';
  }
  return 0;
}
