#include <bits/stdc++.h>
using namespace std;
map<long long int, long long int> m1, m2;
map<long long int, long long int>::iterator itr, itr1, itr2;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, k;
  cin >> n >> k;
  vector<long long int> v;
  long long int x;
  for (long long int i = 0; i < n; i++) {
    cin >> x;
    v.push_back(x);
  }
  long long int ans = 0;
  long long int prev;
  if (v[0] < k)
    prev = v[0];
  else {
    prev = v[0] - k;
    ans++;
  }
  for (long long int i = 1; i < n; i++) {
    long long int z = prev / k;
    if (k * z != prev) {
      z++;
    }
    ans += z;
    long long int d = v[i] - (k * z - prev);
    prev = max((long long int)0, d);
  }
  long long int z = prev / k;
  if (k * z != prev) z++;
  ans += z;
  cout << ans << endl;
  return 0;
}
