#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(0);
  long long int n, m, r = 0, ans = 0;
  long long int s[1000100];
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> s[i];
  for (int i = 0; i < n; i++) {
    if (r > 0) {
      long long int b = m;
      b -= r;
      s[i] -= b;
      if (s[i] < 0) s[i] = 0;
      ans++;
    }
    ans += s[i] / m;
    r = s[i] % m;
  }
  if (r != 0) ans++;
  cout << ans << endl;
  return 0;
}
