#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k, c = 0, t;
  cin >> n >> k;
  long long int arr[n];
  memset(arr, 0, sizeof(arr));
  for (long long int i = 0; i < n; i++) {
    long long int tt, b;
    cin >> tt;
    if (i == n - 1) {
      b = (arr[i] + tt) / k;
      c += b;
      if ((b * k) < arr[i] + tt) c++;
    } else {
      if (arr[i] > 0 && arr[i] + tt <= k)
        c++;
      else if (arr[i] > 0 && arr[i] + tt > k) {
        b = (arr[i] + tt) / k;
        c += b;
        arr[i + 1] = (arr[i] + tt) - (k * b);
      } else if (arr[i] == 0 && tt < k)
        arr[i + 1] = tt;
      else if (arr[i] == 0 && tt >= k) {
        b = tt / k;
        c += b;
        arr[i + 1] = tt - (k * b);
      }
    }
  }
  cout << c << endl;
  return 0;
}
