#include <bits/stdc++.h>
const int maxx = 1e6 + 100;
const double eps = 1e-10;
const int mod = 10007;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
using namespace std;
long long n, m, h, k, T;
long long a[maxx + 5];
long long l, r, ans;
int main() {
  int i, j;
  while (scanf("%lld %lld %lld", &n, &h, &k) == 3) {
    ans = 0;
    for (i = 0; i < n; i++) scanf("%lld", &a[i]);
    long long now = a[0], pos = 0;
    a[n] = 0;
    while (1) {
      while (pos <= n - 1 && (now + a[pos + 1] <= h)) now += a[++pos];
      if (now >= k) {
        ans += now / k;
        now = max(now % k, 0ll);
      } else {
        now = max(now - k, 0ll);
        ans++;
      }
      if (now == 0 && pos >= n - 1) break;
    }
    cout << ans << endl;
  }
  return 0;
}
