#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long h, k, r = 0, c = 0;
  cin >> n >> h >> k;
  long long a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; r++) {
    while (i < n && c + a[i] <= h) {
      c += a[i];
      i++;
    }
    if (i >= n) break;
    int b = max((c - (h - a[i])) / k, 1LL);
    r += b - 1;
    c -= b * k;
    c = max(0LL, c);
  }
  r += ceil(c / double(k));
  cout << r;
  return 0;
}
