#include <bits/stdc++.h>
using namespace std;
const int sq = (int)sqrt((int)1e6);
const int maxnb = (int)1e9 + 7;
const double pi = acos(-1.0);
const int maxnl = 100500;
const double eps = 1e-9;
long long n, h, k, cur, ans, ha[maxnl];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> h >> k;
  for (int i = 1; i <= n; i++) {
    cin >> ha[i];
  }
  for (int i = 1; i <= n; i++) {
    if (cur + ha[i] <= h) {
      cur += ha[i];
    } else {
      ans += (cur < k ? 1 : cur / k);
      cur = (cur < k ? 0 : cur % k);
      i--;
    }
  }
  ans += (cur < k ? 1 : cur / k);
  cur = (cur < k ? 0 : cur % k);
  if (cur) ans += (cur < k ? 1 : cur / k);
  cur = (cur < k ? 0 : cur % k);
  cout << ans;
  return 0;
}
