#include <bits/stdc++.h>
using namespace std;
const long long N = 200010, M = 2000005;
long long n, h, k, a[N], pre, res;
int solve() {
  scanf("%lld", &n);
  scanf("%lld%lld", &h, &k);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
  }
  int i = 0;
  while (i < n) {
    long long sum = pre;
    while (i < n && sum + a[i] <= h) {
      sum += a[i];
      i++;
    }
    if (sum >= k) {
      res += (sum / k);
      pre = sum % k;
    } else {
      res++;
      pre = 0;
    }
  }
  if (pre) res++;
  printf("%lld\n", res);
  return 0;
}
int main() {
  int ret = solve();
  return 0;
}
