#include <bits/stdc++.h>
using namespace std;
long long m, n, k;
vector<long long> str;
int main() {
  cin >> m >> n;
  for (long long i = 0; i < m; i++) {
    cin >> k;
    str.push_back(k);
  }
  long long sum = 0, cnt = 0;
  for (long long i = 0, len = str.size(); i < len; i++) {
    if (sum) {
      long long k = n - sum;
      if (sum + str[i] < n) {
        cnt++;
        sum = 0;
        continue;
      }
      if (k <= str[i]) {
        cnt++;
        str[i] -= k;
      }
      sum = 0;
    }
    cnt += str[i] / n;
    sum += str[i] % n;
  }
  if (sum) cnt++;
  cout << cnt << endl;
}
