#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, h, k;
  cin >> n >> h >> k;
  long long ans = 0;
  long long rem_h = 0;
  long long *a = new long long[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  int f = 0;
  for (long long i = 0; i < n;) {
    if (rem_h + a[i] <= h) {
      rem_h += a[i];
      i++;
    } else {
      ans += rem_h / k;
      if (rem_h % k == rem_h) f++;
      rem_h %= k;
      if (f == 2) {
        ans++;
        rem_h = 0;
        f = 0;
      }
    }
  }
  if (rem_h != 0) {
    ans += (rem_h / k);
    if (rem_h % k != 0) ans++;
  }
  cout << ans;
}
