#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, i, j, k, t = 0, c = 0, y;
  cin >> n >> m;
  int a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
    t += a[i];
    if (a[i] == 0) {
      y = t / m;
      if (y * m != t) c++;
    }
  }
  j = t / m;
  if (j * m == t)
    c = c + j;
  else
    c = c + j + 1;
  cout << c << endl;
  return 0;
}
