#include <bits/stdc++.h>
using namespace std;
void File() {}
bool chk(vector<int>& v, int x) {
  int sum = 0;
  for (int i = 0; i < v.size(); i++) {
    if (sum + v[i] == x)
      sum = 0;
    else if (sum + v[i] < x)
      sum += v[i];
    else
      return 0;
  }
  return sum == x;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  long long rem = 0, cnt = 0;
  for (int i = 0; i < n; i++) {
    if (rem > v[i])
      rem = 0;
    else {
      v[i] -= rem;
      rem = 0;
      int x = ceil(v[i] / double(k));
      cnt += x;
      rem = x * k - v[i];
    }
  }
  cout << cnt << "\n";
}
