#include <bits/stdc++.h>
using namespace std;
long long a[200100];
int main() {
  long long k, Answer = 0;
  int n;
  cin >> n >> k;
  for (int i = 0; i < n; i++) scanf("%I64d", &a[i]);
  for (int i = 0; i < n; i++) {
    Answer += a[i] / k;
    a[i] = a[i] % k;
    if (a[i] + a[i + 1] >= k)
      a[i + 1] += a[i];
    else if (a[i] > 0) {
      a[i + 1] = 0;
      Answer++;
    }
  }
  cout << Answer;
  return 0;
}
