#include <bits/stdc++.h>
using namespace std;
vector<long long int> visited(100005LL);
vector<long long int> ans = {-1};
vector<long long int> level(100005LL);
vector<long long int> ind(100005LL);
long long int sz[100005LL];
int main() {
  long long int n, k;
  cin >> n >> k;
  vector<long long int> arr(n);
  for (long long int i = 0; i < n; i++) cin >> arr[i];
  long long int ans = 0;
  long long int rest = arr[0];
  for (long long int i = 1; i < n; i += 1) {
    ans += (rest + arr[i]) / k;
    rest = (rest + arr[i]) % k;
  }
  ans += rest / k;
  cout << ans << "\n";
  ;
}
