#include <bits/stdc++.h>
using namespace std;
int n;
long long a[200005], k;
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  long long ans = 0;
  long long cur = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] == 0) continue;
    long long x = a[i] / k;
    ans += x;
    cur = a[i] - k * x;
    long long cur2 = k - cur;
    if (cur > 0) {
      if (i < n) {
        ans++;
        if (a[i + 1] - cur2 < 0)
          a[i + 1] = 0;
        else
          a[i + 1] = a[i + 1] - cur2;
      } else {
        ans++;
      }
    }
  }
  cout << ans;
  return 0;
}
