#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, i, ans = 0, s;
  vector<long long> a;
  cin >> n >> k;
  for (i = 0; i < n; i++) {
    cin >> s;
    a.push_back(s);
  }
  s = a[0];
  for (i = 1; i < n; i++) {
    s += a[i];
    ans += s / k;
    s = s % k;
    if (s > a[i]) {
      s = 0;
      ans++;
    }
  }
  ans += (s + k - 1) / k;
  cout << ans;
  return 0;
}
