#include <bits/stdc++.h>
using namespace std;
int n, k;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k;
  unsigned long long result = 0;
  unsigned long long no = 0;
  for (int i = 0; i < n; ++i) {
    unsigned long long temp;
    cin >> temp;
    if (no > 0) {
      if (no + temp <= k) {
        temp = 0;
      } else {
        temp -= (k - no);
      }
      result++;
    }
    result += temp / k;
    no = temp % k;
  }
  if (no != 0) {
    result++;
  }
  cout << result << endl;
  return 0;
}
