#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, h, k;
  scanf("%lld %lld %lld", &n, &h, &k);
  long long a[n];
  for (int i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
  }
  long long time = 0, rem = 0;
  for (int i = 0; i < n; i++) {
    if (rem + a[i] <= h) {
      rem = rem + a[i];
    } else {
      long long lo = 0, hi = 100000007, mid;
      while (hi - lo > 1) {
        mid = (hi + lo) / 2;
        if (rem + a[i] - mid * k <= h) {
          hi = mid;
        } else {
          lo = mid;
        }
      }
      time = time + hi;
      rem = max((long long)0, (long long)rem - k * hi) + a[i];
    }
  }
  printf("%lld\n", time + (long long)ceil((long double)rem / k));
}
