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