#include <bits/stdc++.h>
using namespace std;
long long a[200003];
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long n;
  cin >> n;
  long long k;
  cin >> k;
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long ans = 0;
  long long lft = 0;
  for (long long i = 0; i < n; i++) {
    if (i == n - 1) {
      ans += (lft + a[i]) / k;
      ans += ((lft + a[i]) % k != 0);
      continue;
    }
    if (a[i] + lft < k && i != 0) {
      ans++;
      lft = a[i];
      continue;
    }
    ans += (a[i] + lft) / k;
    lft = (a[i] + lft) % k;
  }
  cout << ans;
  return 0;
}
