#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, z, sum, f, k;
  cin >> x;
  cin >> y;
  f = 0;
  sum = 0;
  for (int i = 0; i < x; i++) {
    cin >> z;
    k = f + z;
    sum = sum + k / y;
    f = k % y;
    if (f > z) {
      sum++;
      f = 0;
    }
  }
  if (f != 0) {
    sum++;
  }
  cout << sum;
}
