#include <bits/stdc++.h>
using namespace std;
struct Q {
  int F, S, th;
};
constexpr signed long long TEN(int n) { return (n == 0) ? 1 : TEN(n - 1) * 10; }
int dr[]{-1, 0, 1, 0};
int dc[] = {0, 1, 0, -1};
void solve() {
  int n;
  signed long long k;
  cin >> n >> k;
  vector<signed long long> v(n);
  for (auto &i : v) cin >> i;
  ;
  signed long long old = 0, now = 0, bags = 0;
  for (int i = 0; i < n; i++) {
    now = v[i] % k;
    if ((old + v[i]) < k && old != 0) {
      bags += k;
      old = 0;
    } else {
      bags += (now + old) / k;
      old = (now + old) % k;
    }
  }
  cout << bags << endl;
}
void solve_2() {
  int t;
  cin >> t;
  while (t--) solve();
}
int main() {
  if (!many____testttt)
    solve();
  else
    solve_2();
  return 0;
}
