#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, k, last = 0, ans = 0, x;
  cin >> n >> k;
  for (long long int i = 0; i < n; i++) {
    cin >> x;
    if (i == n - 1) {
      last += x;
      ans += ceil((long double)(last) / (long double)k);
      break;
    }
    if (x + last >= k) {
      long long int val = (x + last) / k;
      last = (x + last) - val * k;
      ans += val;
    } else {
      if (last) {
        ans += 1;
        last = 0;
      } else
        last = x;
    }
  }
  cout << ans << "\n";
  return 0;
}
