#include <bits/stdc++.h>
const long long iinf = INT64_MAX - 1;
const int inf = INT32_MAX - 1;
const int MOD = (1e6 + 3);
int dir4[4][2] = {{0, 1}, {-1, 0}, {0, -1}, {1, 0}};
int dir8[8][2] = {{1, 0}, {-1, 0}, {0, 1},  {0, -1},
                  {1, 1}, {1, -1}, {-1, 1}, {-1, -1}};
int knight[8][2] = {{2, 1}, {2, -1}, {-2, 1}, {-2, -1},
                    {1, 2}, {-1, 2}, {1, -2}, {-1, -2}};
bool check(int n, int pos) { return n & (1 << pos); }
using namespace std;
void solve() {
  int n, k;
  cin >> n >> k;
  long long ans = 0;
  long long carry = 0;
  for (int i = 1; i <= n; i++) {
    long long x;
    cin >> x;
    x = max(0LL, x - carry);
    long long add = (x + k - 1) / k;
    ans += add;
    carry = add * k - x;
  }
  cout << ans << '\n';
}
int main() {
  int t = 1;
  if (0) cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
