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