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