#include <bits/stdc++.h>
using namespace std;
int n, k, d;
int lixo[200001];
unsigned long long int sacos;
int teto(int a, int b) {
  if (a % b != 0) return a / b + 1;
  return a / b;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> lixo[i];
  }
  sacos = 0;
  for (int i = n - 1; i > 0; i--) {
    d = k - lixo[i] % k;
    lixo[i] += d;
    lixo[i - 1] = max(0, lixo[i - 1] - d);
    sacos += teto(lixo[i], k);
  }
  sacos += teto(lixo[0], k);
  cout << sacos << endl;
  return 0;
}
