#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL), cout.tie(NULL);
  int N, K;
  cin >> N >> K;
  long long ans = 0, prev = 0;
  for (int i = 1; i <= N; i++) {
    int x;
    cin >> x;
    ans += (prev + K - 1) / K;
    prev = max(0LL, x - (K - prev % K) % K);
  }
  ans += (prev + K - 1) / K;
  cout << ans << "\n";
  return 0;
}
