#include <bits/stdc++.h>
using namespace std;
long long n, h, k, ans, cur, a;
int main() {
  while (3 == scanf("%I64d%I64d%I64d", &n, &h, &k)) {
    ans = cur = 0;
    for (int i = 0; i < n; ++i) {
      scanf("%I64d", &a);
      if (cur + a <= h) {
        cur += a;
      } else {
        ans += cur / k;
        cur %= k;
        if (cur + a <= h) {
          cur += a;
        } else {
          ++ans;
          cur = a;
        }
      }
    }
    if (cur >= k) {
      ans += cur / k;
      cur %= k;
    }
    ans += cur > 0 ? 1 : 0;
    printf("%I64d\n", ans);
  }
  return 0;
}
