#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  long long prev_day = 0, now = 0, bags = 0;
  for (int i = 0; i < n; i++) {
    cin >> now;
    if (i == n - 1) {
      if ((prev_day + now) % k == 0)
        bags += (prev_day + now) / k;
      else
        bags += (prev_day + now) / k + 1;
      continue;
    }
    if (prev_day == 0) {
      bags += now / k;
      prev_day = now % k;
    } else {
      if (prev_day + now >= k) {
        bags += (prev_day + now) / k;
        prev_day = (prev_day + now) % k;
      } else {
        bags++;
        prev_day = 0;
      }
    }
  }
  cout << bags;
  return 0;
}
