#include <bits/stdc++.h>
using namespace std;
long long n, h, k, a;
long long v[100010], sum, ans;
int main() {
  cin >> n >> h >> k;
  for (int i = 1; i <= n; i++) cin >> v[i];
  for (int i = 1; i <= n; i++) {
    if (sum + v[i] <= h)
      sum += v[i], a = 0;
    else if (sum + v[i] > h || i == n)
      ans += sum / k, sum %= k, i--, a++;
    if (a == 2) sum = 0, ans++;
  }
  ans += sum / k, sum %= k;
  if (sum != 0) ans++;
  cout << ans;
}
