#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, t = 0, m = 0, cnt = 0, x = 0, y = 0;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> x;
    t = m;
    y = x + m;
    m = y % k;
    cnt += y / k;
    if (y / k == 0 && i && t != 0) {
      cnt++;
      m = 0;
    }
  }
  if (m) {
    cnt++;
  }
  cout << cnt << endl;
}
