#include <bits/stdc++.h>
using namespace std;
int a[100005];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int ans = 0;
  int res = a[0] % k;
  ans += a[0] / k;
  for (int i = 1; i < n; i++) {
    if (res + a[i] <= k && res != 0) {
      ans++;
      res = 0;
    } else if (res == 0 && a[i] < k) {
      res = a[i] % k;
    } else if (a[i] == k && res == 0) {
      ans++;
    } else if (res != 0 && res + a[i] > k) {
      res = (res + a[i]) % k;
      ans += (res + a[i]) / k;
    }
    if (i == n - 1 && res != 0) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
