#include <bits/stdc++.h>
using namespace std;
long long n, k, flag, ans;
long long a[200001];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  if (a[0] >= k) {
    ans += (a[0] / k);
    a[0] = a[0] % k;
    if (a[0] != 0) flag = 1;
  } else if (a[0] != 0)
    flag = 1;
  for (int i = 1; i < n; i++) {
    if (flag == 1) {
      if (a[i - 1] + a[i] >= k) {
        ans += (a[i - 1] + a[i]) / k;
        a[i] = (a[i - 1] + a[i]) % k;
        if (a[i] == 0) flag = 0;
      } else {
        ans++;
        flag = 0;
      }
    } else {
      if (a[i] >= k) {
        ans += (a[i] / k);
        a[i] = a[i] % k;
        if (a[i] != 0) flag = 1;
      } else
        flag = 1;
    }
  }
  if (flag == 1 and a[n - 1] != 0) ans++;
  cout << ans;
  return 0;
}
