#include <bits/stdc++.h>
using namespace std;
template <typename T>
using vc = vector<T>;
using pii = pair<long long, long long>;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n, k;
  cin >> n >> k;
  vc<long long> a(n + 1);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long rest = 0;
  long long res = 0;
  for (long long i = 0; i <= n; i++) {
    long long anz = (rest + a[i]) / k;
    if (anz == 0 && rest != 0) {
      rest = 0;
      res++;
    } else {
      res += anz;
      rest = (rest + a[i]) % k;
    }
  }
  cout << res << "\n";
}
