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