#include <bits/stdc++.h>
const int Inf = 1e9;
long long LINF = (long long)4e18;
using namespace std;
long long mod = 1e9 + 7;
long long mod2 = 1e9 + 123;
void die() {
  cout << "No";
  exit(0);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  vector<long long> a(n);
  for (int(i) = 0; (i) < n; (i)++) cin >> a[i];
  long long last = 0;
  long long ans = 0;
  for (int(i) = 0; (i) < n; (i)++) {
    long long sum = last + a[i];
    if (i == n - 1) {
      ans += (sum + k - 1) / k;
      break;
    }
    long long cnt = sum / k;
    long long mn = (last + k - 1) / k;
    long long rescnt = max(cnt, mn);
    ans += rescnt;
    last = sum - (rescnt * k);
    last = max(last, (long long)0);
  }
  cout << ans;
  return 0;
}
