#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  long long arr[200005];
  memset(arr, 0, sizeof arr);
  for (long long i = 0; i < n; i++) cin >> arr[i];
  long long ans = 0, temp = 0, carry = 0;
  for (long long i = 0; i < n; i++) {
    if (i == n - 1) {
      arr[i] += carry;
      if (arr[i] % k == 0)
        ans += arr[i] / k;
      else
        ans += (arr[i] / k) + 1;
    } else {
      if (carry != 0) {
        ans += carry / k;
        carry = carry % k;
        if (carry != 0) {
          ans++;
          arr[i] = arr[i] - min(arr[i], k - carry);
        }
        ans += arr[i] / k;
        arr[i] = arr[i] % k;
      }
      carry = arr[i];
    }
  }
  cout << ans << endl;
}
