#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 22;
const int INF = 1e9;
long long int n, h, k, a[MAXN], x, z, sw, ans;
int main() {
  cin >> n >> h >> k;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  z = 0;
  x = 0;
  sw = 0;
  while (x < n || z != 0) {
    sw = 0;
    while (x != n && sw != 1) {
      if (h >= z + a[x]) {
        z += a[x];
        x++;
      } else {
        sw = 1;
      }
    }
    if (z > k) {
      int q;
      q = z / k;
      z -= q * k;
      ans += q;
    } else {
      z = 0;
      ans++;
    }
  }
  cout << ans;
  return 0;
}
