#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 2e5 + 10;
long long a[maxn];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  long long sum = 0;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
  }
  ans += a[0] / k;
  sum = a[0] % k;
  for (int i = 1; i < n; i++) {
    if (sum != 0) {
      if (sum + a[i] <= k) {
        ans++;
        sum = 0;
      } else {
        sum += a[i];
        ans += sum / k;
        sum %= k;
      }
    } else {
      ans += a[i] / k;
      sum += a[i] % k;
    }
  }
  if (sum) ans++;
  cout << ans;
  return 0;
}
