#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, h, k, sum = 0, t = 0, tt = 0;
  cin >> n >> h >> k;
  long long int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (sum + a[i] <= h) {
      sum += a[i];
    } else if (sum + a[i] > h) {
      int fr = 0;
      fr += (h - sum);
      t = (int)ceil((double)(a[i] - fr) / (double)k);
      tt = tt + t;
      sum -= t * k;
      if (sum < 0) sum = 0;
      sum += a[i];
    }
  }
  if (sum != 0) tt += (int)ceil((double)sum / (double)k);
  cout << tt;
}
