#include <bits/stdc++.h>
using namespace std;
const int inf1 = (int)1e9 + 1;
const long long INF1 = (long long)1e18 + 1;
const int inf = (int)2147483647;
const long long INF = (long long)9223372036854775807ll;
const int N6 = (int)1e6 + 1;
const int N5 = (int)1e5 + 1;
const int N4 = (int)1e4 + 1;
const int N3 = (int)1e3 + 1;
const int N2 = (int)1e2 + 1;
const int mod = (int)1e9 + 7;
int i, j;
int n, h, k;
int a, now;
long long cnt;
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> h >> k;
  for (i = 1; i <= n; i++) {
    cin >> a;
    if (now + a <= h) {
      now += a;
    } else {
      cnt += now / k;
      now %= k;
      if (now + a <= h) {
        now += a;
      } else {
        cnt++;
        now = a;
      }
    }
  }
  if (now) cnt += (now + (k - 1)) / k;
  cout << cnt;
  return 0;
}
