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