#include <bits/stdc++.h>
using namespace std;
int a[200000];
int main() {
  int n, k;
  cin >> n;
  cin >> k;
  int sum = 0, left = 0, d = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum = sum + a[i];
    if (sum >= k) {
      left = sum - sum / k * k;
      d = sum / k + d;
      sum = left;
    } else {
      d++;
      left = 0;
      sum = left;
    }
    if (i == n - 1) {
      d += 1;
    }
  }
  cout << d;
  return 0;
}
