#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  unsigned long long n, m;
  cin >> n >> m;
  unsigned long long prev = 0, bag = 0;
  for (int i = 0; i < n; i++) {
    unsigned long long a;
    cin >> a;
    bag += ((a + prev) / m);
    prev = ((a + prev) % m);
    if (prev > a) {
      bag++;
      prev = 0;
    }
  }
  if (prev > 0) bag++;
  cout << bag << endl;
}
