#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  long long *a = new long long[n + 1];
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long bags = 0, rem = 0;
  for (long long i = 0; i < n; i++) {
    bags += rem / k;
    rem = rem % k;
    if (rem + a[i] > k) rem = (rem + a[i]) - k;
    if (a[i] != 0) bags++;
  }
  cout << bags;
  delete[] a;
  return 0;
}
