#include <bits/stdc++.h>
const long long int mod = 1000000007;
const long long int M = 100005;
const double pi = acos(-1.0);
using namespace std;
int32_t main() {
  auto start = std::chrono::high_resolution_clock::now();
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int t;
  t = 1;
  while (t--) {
    long long int n, h, k;
    cin >> n >> h >> k;
    long long int a[n];
    for (long long int i = 0; i < n; i++) {
      cin >> a[i];
    }
    long long int x = 0;
    long long int ans = 0;
    for (long long int i = 0; i < n; i++) {
      if (x + a[i] <= h) {
        long long int j = i;
        while (j < n) {
          x += a[j];
          if (x > h) {
            x -= a[j];
            break;
          }
          j++;
        }
        i = j - 1;
        x -= k;
        x = max(x, 0ll);
        ans++;
      } else {
        long long int y = h - a[i];
        long long int z = (x - y) / k;
        x -= (z * k);
        ans += z;
        if (x > y) {
          x -= k;
          x = max(x, 0ll);
          ans++;
        }
        i--;
      }
    }
    if (x != 0) {
      ans += (x / k);
      if (x % k != 0) {
        ans++;
      }
    }
    cout << ans;
  }
  auto stop = std::chrono::high_resolution_clock::now();
  auto duration =
      std::chrono::duration_cast<std::chrono::nanoseconds>(stop - start);
}
