#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n, h, k;
  cin >> n >> h >> k;
  long long elapsed = 0;
  int ch = 0;
  for (int i = 0; i < n; i++) {
    int potato;
    cin >> potato;
    if (ch + potato <= h) {
      ch += potato;
    } else {
      int div = ch / k;
      ch -= div * k;
      elapsed += div;
      if (ch + potato <= h) {
        ch += potato;
      } else {
        elapsed++;
        ch = potato;
      }
    }
  }
  int div = ch / k;
  ch -= div * k;
  elapsed += div;
  if (ch) {
    elapsed++;
  }
  cout << elapsed << endl;
  return 0;
}
