#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, k, i;
  cin >> n >> k;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  ;
  long long ans = a[0] / k, x = a[0] % k;
  for (i = 1; i < n; i++) {
    if (x == 0) {
      ans += (a[i]) / k;
      x = a[i] % k;
    } else {
      long long y = k - x;
      if (a[i] - y >= 0) {
        a[i] -= y;
      } else
        a[i] = 0;
      ans++;
      ans += a[i] / k;
      x = a[i] % k;
    }
  }
  if (x) ans++;
  cout << ans;
}
