#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, k, g = 0;
  cin >> n >> k;
  long long count = 0, carry = 0;
  while (n--) {
    long long temp;
    cin >> temp;
    g += temp;
    if (n == 0) {
      count += g / k;
      if (g % k > 0) count++;
      continue;
    }
    if (carry == 1 && g / k == 0) {
      count++;
      carry = 0;
      g = 0;
      continue;
    }
    count += g / k;
    g = g - ((g / k) * k);
    if (g > 0) {
      carry = 1;
    } else {
      carry = 0;
    }
  }
  cout << count << endl;
  return 0;
}
