#include <bits/stdc++.h>
using namespace std;
const int sz = 100001;
long long a[sz];
int main() {
  long long n, h, k;
  std::cin >> n >> h >> k;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  long long cnt = 0;
  long long comb = 0;
  for (int i = 0; i < n; ++i) {
    if (comb + a[i] <= h) {
      comb += a[i];
    } else {
      ++cnt;
      comb = a[i];
    }
    cnt += comb / k;
    comb %= k;
  }
  comb += comb / k;
  comb %= k;
  cnt += (comb > 0) ? 1 : 0;
  cout << cnt;
  return 0;
}
