#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k;
  cin >> n >> k;
  long long int pf[n];
  for (long long int a = 0; a < n; a++) cin >> pf[a];
  long long count = 0;
  for (int a = 0; a < n - 1; a++) {
    long long int d = (pf[a] + pf[a + 1]) / k;
    count += d;
    if (pf[a] + pf[a + 1] - d * k > pf[a + 1]) {
      count++;
      pf[a + 1] = 0;
    } else
      pf[a + 1] = pf[a] + pf[a + 1] - d * k;
  }
  if (pf[n - 1] != 0) count++;
  cout << count;
}
