#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 10;
const int MOD = 1e9 + 7;
long long a[MAX];
long long d[MAX][2];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i - 1] > 0) {
      ans++;
      a[i] -= min(a[i], k - a[i - 1]);
      a[i - 1] = 0;
    }
    ans += a[i] / k;
    a[i] %= k;
  }
  ans += (a[n] + k - 1) / k;
  cout << ans << endl;
  return 0;
}
