#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, h, k, a, sum = 0, time = 0;
  cin >> n >> h >> k;
  for (long long i = 0; i < n; i++) {
    cin >> a;
    if (sum + a > h) {
      time += sum / k;
      sum = sum % k;
      if (sum + a > h) {
        time++;
        sum = 0;
      }
      sum += a;
    } else
      sum += a;
  }
  time += sum / k;
  if (sum % k) time++;
  cout << time;
  return 0;
}
