#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1000000000")
using namespace std;
using pii = pair<int, int>;
using ll = long long;
using pll = pair<long long, long long>;
using pil = pair<int, long long>;
using vi = vector<int>;
using vll = vector<long long>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vpii = vector<pair<int, int>>;
using vd = vector<double>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
const ll mod = 1e9 + 7;
const ll INF = 1e18;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  ll ttl = 0, left = 0;
  cin >> n >> k;
  vi a(n);
  for (auto& x : a) cin >> x;
  for (int i = 0; i < n; i++) {
    if (left) {
      a[i] = max(0ll, a[i] - (k - left));
      ++ttl;
      left = 0;
    }
    ttl += a[i] / k;
    a[i] %= k;
    left = a[i];
  }
  if (left) ++ttl;
  cout << ttl;
  return 0;
}
