#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, h, k;
  cin >> n >> h >> k;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  int i = 0;
  int cnt = 0;
  long long ans = 0;
  while (i < n) {
    while (i < n && cnt + a[i] <= h) {
      cnt += a[i];
      i++;
    }
    if (cnt <= k) {
      ans++;
      cnt = 0;
    } else {
      if (i == n) {
        ans += cnt / k;
        cnt = cnt % k;
        if (cnt) ans++;
      } else {
        ans += cnt / k;
        cnt = cnt % k;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
