#include <bits/stdc++.h>
using namespace std;
unsigned long long int modulo(unsigned long long int a,
                              unsigned long long int b) {
  unsigned long long int r;
  r = a - ((a / b) * b);
  if (r < 0) r += b;
  return r;
}
int main() {
  unsigned long long int n, k;
  cin >> n >> k;
  unsigned long long int A = 0, x;
  unsigned long long int res = 0;
  int s;
  for (unsigned long long int i = 0; i < n; ++i) {
    cin >> x;
    if (x == 0) {
      (modulo(A, k) == 0) ? s = 0 : s = 1;
      res += (A / k) + s;
      A = 0;
    }
    A += x;
  }
  (modulo(A, k) == 0) ? s = 0 : s = 1;
  res += (A / k) + s;
  cout << res;
  return 0;
}
