#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e4 + 1;
const long long int MOD = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int d, k, x;
  cin >> d >> k;
  vector<long long int> tem;
  for (int i = 0; i < d; i++) {
    cin >> x;
    tem.push_back(x);
  }
  long long int ans = 0, carry = 0;
  for (int i = 0; i < tem.size(); i++) {
    if (tem[i] == 0 && carry != 0) {
      ans++;
      carry = 0;
      continue;
    }
    tem[i] += carry;
    ans += tem[i] / k;
    carry = tem[i] % k;
  }
  if (carry > 0) {
    ans += carry / k;
    if (carry != 0) ans++;
  }
  cout << ans << '\n';
  return 0;
}
