#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  long long a[n];
  for (long long i = 0; i < n; ++i) cin >> a[i];
  long long cnt = 0;
  long long left = 0;
  for (long long i = 0; i < n; ++i) {
    cnt += (a[i] + left) / k;
    if ((a[i] + left) < k && left > 0) {
      cnt++;
      left = 0;
    } else
      left = (a[i] + left) % k;
    if (i == n - 1 && left > 0) cnt++;
  }
  cout << cnt << '\n';
}
