#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
const int INF = 0x3f3f3f3f;
const double eps = 1e-2;
const int N = 3e5 + 50;
const double PI = acos(-1.);
const double E = 2.71828182845904523536;
const int MOD = 1000000007;
int a[(int)1e5 + 7];
int main() {
  int n, k, h, now = 0;
  long long ans = 0;
  cin >> n >> h >> k;
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  int id = 0;
  while (id < n) {
    while (id < n && now + a[id] <= h) {
      now += a[id];
      id++;
    }
    ans += 1ll * now / k;
    now %= k;
    if (id < n && now + a[id] > h) ans++, now = 0;
  }
  ans += 1ll * now / k;
  ans += 1ll * (now % k != 0);
  cout << ans << endl;
  return 0;
}
