#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long int s = 0, c = 0;
  for (int i = 0; i < n - 1; i++) {
    s = a[i] + a[i + 1];
    if (a[i + 1] == 0 && a[i] % k != 0)
      c = c + s / k + 1;
    else
      c = c + s / k;
    if (s >= k)
      a[i + 1] = s % k;
    else
      a[i + 1] = 0;
  }
  if (a[n - 1] != 0)
    cout << c + 1;
  else
    cout << c;
  return 0;
}
