#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  long long int n, k, cry = 0, bags = 0;
  cin >> n >> k;
  long long int* arr = new long long int[n]{};
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int i = 0; i < n; i++) {
    if (cry != 0 && (cry + arr[i]) / k == 0) {
      bags += 1;
      cry = 0;
    } else {
      bags += (cry + arr[i]) / k;
      cry = (cry + arr[i]) % k;
    }
  }
  if (cry != 0) bags += 1;
  cout << bags;
  return 0;
}
