#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  long long h, k;
  cin >> n >> h >> k;
  vector<int> a(n);
  for (int _n(n), i(0); i < _n; i++) {
    cin >> a[i];
  }
  reverse((a).begin(), (a).end());
  long long ans = 0;
  long long cur = 0;
  while (!a.empty()) {
    int x = -1;
    bool done = false;
    for (; !a.empty();) {
      x = a.back();
      if (cur + x > h) break;
      cur += x;
      a.pop_back();
      done = true;
    }
    long long r = cur + x - h;
    long long num = (r + k - 1) / k;
    num = min(num, (cur + k - 1) / k);
    num = max(num, 1ll);
    ans += num;
    cur -= num * k;
    cur = max(0ll, cur);
  }
  if (cur > 0) {
    ans += (cur + k - 1) / k;
  }
  cout << ans << endl;
  return 0;
}
