#include <bits/stdc++.h>
int main() {
  long long n, k, a[10000];
  int i;
  while (~scanf("%lld%lld", &n, &k)) {
    long long t = 0, sum = 0, exist;
    for (i = 1; i <= n; i++) {
      scanf("%lld", &a[i]);
      t = (t + a[i]) % k;
      exist = (a[i] + t) / k;
      sum += exist;
      if (i == n) sum += t;
    }
    printf("%lld\n", sum);
  }
  return 0;
}
