#include <bits/stdc++.h>
using namespace std;
const double PI = 2.0 * acos(0.0);
const int MOD = 1e9 + 7;
const int oo = 2e9 + 1e8;
long long gcd(long long x, long long y) { return !y ? x : gcd(y, x % y); }
int main() {
  long long n, h, k, ans = 0;
  cin >> n >> h >> k;
  vector<long long> in(n);
  for (int i = 0; i < n; i++) scanf("%I64d", &in[i]);
  long long tmp = 0;
  for (int i = 0; i < n; i++) {
    if (tmp + in[i] <= h)
      tmp += in[i];
    else {
      ans += tmp / k;
      tmp %= k;
      if (tmp + in[i] <= h) {
        ans += (tmp + in[i]) / k;
        tmp = (tmp + in[i]) % k;
      } else
        ans++, tmp = in[i];
    }
  }
  cout << ans + tmp / k + (tmp % k != 0) << '\n';
  return 0;
}
