#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  long long n, k, sum = 0, rest = 0;
  cin >> n >> k;
  vector<long long> x(n);
  for (__typeof(0) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       (0) > (n) ? i-- : i++)
    cin >> x[i];
  for (__typeof(0) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       (0) > (n) ? i-- : i++) {
    sum += (rest + x[i]) / k;
    rest = (rest + x[i]) % k;
    if (rest > x[i]) {
      rest = 0;
      sum++;
    }
  }
  if (rest) sum++;
  cout << sum << endl;
  return 0;
}
