#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-8;
void fast() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
bool sortby(const pair<int, int>& a, const pair<int, int>& b) {
  if (a.first >= b.first && a.second >= b.second) return true;
  return false;
}
double area(int x1, int y1, int x2, int y2, int x3, int y3) {
  return abs((x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)) / 2.0);
}
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  fast();
  long long n, k;
  cin >> n >> k;
  vector<long long> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  long long a = 0, ans = 0;
  for (int i = 0; i < n; i++) {
    v[i] -= a;
    if (v[i] < 0) {
      a = 0;
      continue;
    }
    long long b = v[i] / k;
    if (v[i] % k != 0) {
      a = k - (v[i] % k);
      b++;
    } else
      a = 0;
    ans += b;
  }
  cout << ans << endl;
  return 0;
}
