#include <bits/stdc++.h>
#pragma GCC optimize(3)
using namespace std;
const long long llINF = 9223372036854775807;
const int INF = 2147483647;
const int maxn = 2e5 + 7;
const int maxm = 2e5 + 7;
const int mod = 998244353;
int n, k;
long long cur;
long long ans;
int main(int argc, char const *argv[]) {
  scanf("%d%d", &n, &k);
  scanf("%lld", &cur);
  for (int i = 1; i < n; i++) {
    long long x;
    scanf("%lld", &x);
    long long y = cur % k;
    if (y) y = k - y;
    y = min(y, x);
    cur += y;
    ans += (cur % k) ? (cur / k + 1) : (cur / k);
    cur = x - y;
  }
  ans += (cur % k) ? (cur / k + 1) : (cur / k);
  printf("%lld\n", ans);
  return 0;
}
