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