#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int MaxN = 1e6;
int n, k;
int s[MaxN];
long long ans;
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    scanf("%d", &s[i]);
  }
  for (int i = 0; i < n; i++) {
    if (s[i] % k == 0) {
      ans += s[i] / k;
    } else {
      ans += (s[i] / k) + 1;
      s[i + 1] -= k - (s[i] % k);
      if (s[i + 1] < 0) s[i + 1] = 0;
    }
  }
  cout << ans << endl;
  return 0;
}
