#include <bits/stdc++.h>
using namespace std;
void TxtRead() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
const int N = 1e5 + 5;
const long long INF = 1e9 + 5;
const long long MOD = 1e9 + 7;
const double PI = 3.141592653589793116;
int n, k;
long long ans, yt, a[N];
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
  }
  int x = 0;
  for (int i = 0; i < n - 1; i++) {
    x = (yt + a[i]) / k;
    if (i && !x) x = 1;
    ans += x;
    yt = (a[i] + yt) % k;
  }
  ans += (a[n - 1] + yt + k - 1) / k;
  printf("%lld", ans);
}
