#include <bits/stdc++.h>
using namespace std;
int a[200005];
int main() {
  int n, k;
  long long ans = 0;
  cin >> n >> k;
  for (int i = 0; i < n; i++)
    scanf("%d", a + i),
        a[i] -= min(a[i], k * (a[i - 1] % k != 0) - a[i - 1] % k),
        ans += (a[i] + k - 1) / k;
  cout << ans;
}
