#include <bits/stdc++.h>
using namespace std;
long long n, k, h;
long long ans, now, tot;
long long a[100010];
int main() {
  scanf("%lld%lld%lld", &n, &h, &k);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  while (tot < n) {
    while (tot + 1 <= n && now + a[tot + 1] <= h) {
      now += a[++tot];
    }
    if (now <= k) {
      ans++;
      now = 0;
    }
    ans += now / k;
    now %= k;
  }
  if (now > 0) ans++;
  printf("%lld\n", ans);
}
