#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  long long dp[n + 1][10005];
  long long w, b, x;
  cin >> w >> b >> x;
  long long c[n + 1], cost[n + 1];
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    cin >> c[i];
    cnt += c[i];
  }
  for (int i = 1; i <= n; i++) cin >> cost[i];
  dp[1][0] = w;
  for (int i = 1; i <= c[1]; i++) {
    if (cost[1] * i > w)
      dp[1][i] = -1;
    else {
      dp[1][i] = w - cost[1] * i;
    }
  }
  for (int i = c[1] + 1; i <= cnt; i++) dp[1][i] = -1;
  for (int i = 2; i <= n; i++) {
    for (int j = 0; j <= cnt; j++) {
      dp[i][j] = -1e9;
      for (int k = 0; k <= c[i]; k++) {
        if (j < k) break;
        if (dp[i - 1][j - k] < 0) continue;
        long long tmp = dp[i - 1][j - k] + x;
        tmp = min(w + (j - k) * b, tmp);
        tmp -= k * cost[i];
        if (tmp < 0) tmp = -1;
        dp[i][j] = max(dp[i][j], tmp);
      }
    }
  }
  int i = cnt;
  for (i = cnt; i >= 0; i--)
    if (dp[n][i] >= 0) break;
  cout << i << endl;
}
