#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
long long a[maxn], ans[maxn];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, k, ans = 0;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    a[i] += a[i - 1];
    if (a[i] < k && a[i - 1] != 0) {
      ans++;
      a[i] = 0;
    } else {
      ans += a[i] / k;
      a[i] %= k;
    }
  }
  if (a[n]) ans++;
  cout << ans;
  return 0;
}
