#include <bits/stdc++.h>
using namespace std;
long long garb[200001];
int main() {
  long long n, k;
  cin >> n >> k;
  for (long long i = 0; i < n; i++) {
    scanf("%lld", &garb[i]);
  }
  long long y = 0, c = 0;
  for (long long i = 0; i < n; i++) {
    if (y != 0) {
      if (k - y >= garb[i]) {
        garb[i] = 0;
        c++;
      } else {
        garb[i] -= (k - y);
        c++;
      }
    }
    c += (garb[i]) / k;
    y = garb[i] % k;
  }
  if (y) {
    c++;
  }
  cout << c << endl;
}
