#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, h, k;
  while (~scanf("%lld%lld%lld", &n, &h, &k)) {
    long long ans = 0, sum = 0, x;
    for (long long i = 0; i < n; i++) {
      scanf("%lld", &x);
      if (sum + x > k) {
        ans++;
        if (sum + x <= h) x -= (k - sum);
        ans += x / k;
        sum = x % k;
      } else
        sum += x;
    }
    if (sum) ans++;
    printf("%lld\n", ans);
  }
  return 0;
}
