#include <bits/stdc++.h>
using namespace std;
const int maxN = 2e5 + 5;
int a[maxN];
void solve() {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  long long int ans = 0;
  for (int i = 1; i <= n; i++) {
    long long int x = (a[i] + k - 1) / k;
    ans += x;
    long long int left = x * k - a[i];
    a[i + 1] = max(0LL, a[i + 1] - left);
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  srand(chrono::high_resolution_clock::now().time_since_epoch().count());
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
