#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long int n, k, n1, bags = 0, carry = 0;
  vector<long long int> carr1;
  cin >> n >> k;
  for (long long int i = 0; i < n; i++) {
    cin >> n1;
    if (i == 0) {
      bags += n1 / k;
      carry = n1 % k;
      carr1.push_back(carry);
    } else {
      if (i > 1) {
        if (carr1[0] % k == 0) {
          bags += carr1[0] / k;
        } else {
          bags += (carr1[0] / k) + 1;
        }
        carr1.erase(carr1.begin());
      }
      if (n1 + carry < k) {
        bags += 1;
      }
      bags += (n1 + carr1[0]) / k;
      carry = (n1 + carr1[0]) % k;
      carr1[0] = 0;
      carr1.push_back(carry);
    }
  }
  cout << bags;
  return 0;
}
