#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k, i, t, ans = 0, previous = 0, current = 0;
  cin >> n >> k;
  long long int A[n];
  for (i = 0; i < n; i++) {
    cin >> A[i];
    if (i == 0) {
      current = A[i];
      ans = current / k;
      previous = current - (ans * k);
    } else {
      current = A[i];
      if (previous != 0) {
        ans++;
        if (k - previous >= current) {
          current = 0;
          previous = 0;
        } else
          current = current - (k - previous);
      }
      if (current != 0) {
        t = current / k;
        previous = current - (t * k);
        ans += t;
      }
    }
  }
  if (previous != 0) ans++;
  cout << ans << endl;
}
