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