#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long max(long long a, long long b) { return (a > b ? a : b); }
void printa(long long arr[], long long n) {
  for (long long i = 0; i < n; i++) {
    cout << arr[i] << ' ';
  }
  cout << "\n";
}
void printv(vector<long long> v) {
  for (long long i = 0; i < v.size(); i++) {
    cout << v[i] << ' ';
  }
  cout << "\n";
}
void printset(set<long long> s) {
  for (auto x : s) {
    cout << x << " ";
  }
  cout << "\n";
}
void printmset(multiset<long long> s) {
  for (auto x : s) {
    cout << x << " ";
  }
  cout << "\n";
}
void printmgset(multiset<long long, greater<long long>> s) {
  for (auto x : s) {
    cout << x << " ";
  }
  cout << "\n";
}
const long long inf = 1e18;
const int32_t M = 1e9 + 7;
const int32_t MM = 998244353;
long long fact(long long n) { return (n == 1 || n == 0) ? 1 : n * fact(n - 1); }
const long long N = 1e8;
void solve() {
  long long n, k;
  cin >> n >> k;
  vector<long long> v(n + 1);
  for (long long i = 0; i < (n); ++i) {
    cin >> v[i];
  }
  long long c = 0;
  for (long long i = 1; i < (n + 1); ++i) {
    long long t = (v[i - 1] + k - 1) / k;
    long long l = t * k - v[i - 1];
    v[i] = max(0, v[i] - l);
    c += t;
  }
  cout << c << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  while (t--) solve();
  cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
  return 0;
}
