#include <bits/stdc++.h>
using namespace std;
int tc = 1;
vector<string> split(const string &s, char c) {
  vector<string> v;
  stringstream ss(s);
  string x;
  while (getline(ss, x, c)) v.emplace_back(x);
  return move(v);
}
void err(vector<string>::iterator it) {}
template <typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
  cout << it->substr((*it)[0] == ' ', it->length()) << " = " << a << " ";
  err(++it, args...);
}
const int M = 1e9 + 7;
const long long Inf = (long long)2e18 + 5;
const int N = 2e5 + 5;
long long vis[N], res[N];
int solve() {
  long long n, k;
  cin >> n >> k;
  long long a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long extra = 0;
  long long cnt = 0;
  long long x = 0;
  for (int i = 0; i < n; i++) {
    if ((a[i] + extra) % k <= a[i]) {
      x = a[i] + extra;
      if (i == n - 1)
        cnt += (x + k - 1) / k;
      else
        cnt += (x) / k;
      extra = x % k;
    } else {
      if (extra) cnt++;
      extra = 0;
    }
  }
  cout << cnt << endl;
  return 0;
}
int main() {
  int test = 1;
  while (test--) solve();
  return 0;
}
