#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, h, k;
  scanf("%d %d %d", &n, &h, &k);
  long long total = 0;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    if (a + total <= h)
      total += a;
    else {
      ans += total / k;
      total = total % k;
      if (a + total > h) {
        ans++;
        total = 0;
      }
      total += a;
    }
  }
  if (total) ans += (total + k - 1) / k;
  cout << ans << endl;
  return 0;
}
