#include <bits/stdc++.h>
using namespace std;
int n, h, k, a[100005];
int main() {
  cin >> n >> h >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  long long ret = 0;
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    int e = i;
    if (sum + a[i] > h) {
      sum = 0;
      ret++;
    }
    while (e < n && sum + a[e] <= h) {
      sum += a[e];
      e++;
    }
    i = e - 1;
    ret += sum / k;
    sum %= k;
  }
  if (sum) ret++;
  cout << ret;
}
