#include <bits/stdc++.h>
using namespace std;
int arr[112345];
void init() {}
void solve() {
  int n, h, k;
  scanf("%d%d%d", &n, &h, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
  }
  int left = 0;
  int idx = 0;
  long long ans = 0;
  int temp;
  while (idx < n || left > 0) {
    while (idx < n && left + arr[idx] <= h) left += arr[idx++];
    if (idx < n)
      temp = left + arr[idx] - h;
    else
      temp = left;
    ans += (temp + (k - 1)) / k;
    left -= ((temp + (k - 1)) / k) * k;
    left = max(left, 0);
  }
  printf("%lld\n", ans);
}
int main() {
  init();
  int t = 1;
  for (int i = 1; i <= t; i++) {
    solve();
  }
}
