#include <bits/stdc++.h>
int main() {
  int n, k;
  std::cin >> n >> k;
  long long int result = 0;
  int x;
  int rest = 0;
  while (n-- > 0) {
    std::cin >> x;
    if (rest) {
      ++result;
    }
    if (x >= rest) {
      x -= rest;
      result += x / k;
      rest = x % k;
    } else {
      rest = 0;
    }
  }
  if (rest) {
    ++result;
  }
  std::cout << result << std::endl;
  return 0;
}
