#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 9;
int main() {
  ios_base::sync_with_stdio(0);
  long long n, k;
  cin >> n >> k;
  vector<long long> a(n);
  long long ex = 0, ans = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    a[i] = max(0LL, a[i] - ex);
    long long need = (a[i] + k - 1) / k;
    ans += need;
    ex = need * k - a[i];
  }
  cout << ans;
}
