#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9 + 1;
const double EPS = 1e-9;
const int MAXN = (int)1e5;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  int a[n];
  for (int i = (0); i < (int)(n); i++) cin >> a[i];
  long long sum = 0, ans = 0;
  for (int i = (0); i < (int)(n); i++) {
    if (a[i] == 0) continue;
    if (i != n - 1)
      sum = a[i] + a[i + 1];
    else
      sum = a[i];
    if (sum < k) {
      ans++;
      a[i + 1] = 0;
      continue;
    }
    ans += sum / k;
    if (i == n - 1 && sum % k) ans++;
    a[i + 1] = sum % k;
  }
  cout << ans;
}
