#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, k, ats = 0, last = 0, cur;
  cin >> n >> k;
  while (n--) {
    cin >> cur;
    ats += last / k;
    last %= k;
    if (last > 0) ats++, cur -= k - last;
    last = cur;
  }
  ats += (cur + k - 1) / k;
  cout << ats;
}
