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