#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int main() {
  long long int n, k;
  cin >> n >> k;
  vector<long long int> arr(n);
  for (auto &it : arr) cin >> it;
  long long int leftover = arr[0] % k;
  long long int ans = arr[0] / k;
  int flag = 0;
  for (int i = 1; i < n; i++) {
    leftover += arr[i];
    if (leftover > 0 && leftover <= k) {
      ans++;
      leftover = 0;
    } else {
      ans += leftover / k;
      leftover -= k * (leftover / k);
    }
  }
  if (leftover > 0) ans++;
  cout << ans;
  return 0;
}
