#include <bits/stdc++.h>
using namespace std;
long long n, k, rem, ans, x;
int main() {
  cin >> n >> k;
  for (long long i = 0; i < n; i++) {
    cin >> x;
    if (rem > 0) {
      if ((rem + x) < k) {
        ans++;
        rem = 0;
      } else {
        ans += (rem + x) / k;
        rem = (rem + x) % k;
      }
    } else {
      ans += x / k;
      rem = x % k;
    }
  }
  if (rem != 0) ans++;
  cout << ans;
  return 0;
}
