#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long k, x = 0, y = 0, ans = 0;
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) {
    cin >> y;
    x += y;
    if (x / k != 0) {
      ans += x / k;
      x %= k;
    } else if (x != y || (x == y && y == 0)) {
      ans += 1;
      x = 0;
    }
  }
  if (x != 0) ans += 1;
  cout << ans;
}
