#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200005;
int n;
long long k, a[MAXN];
int main() {
  scanf("%d%lld", &n, &k);
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
  }
  for (int i = 1; i < n; i++) {
    long long cnt = (a[i - 1] + k - 1) / k;
    sum += cnt;
    a[i] = max(0LL, a[i] + a[i - 1] - cnt * k);
  }
  sum += (a[n - 1] + k - 1) / k;
  printf("%lld\n", sum);
  return 0;
}
