#include <bits/stdc++.h>
void read(int &x) {
  x = 0;
  int flag = 1;
  char ch = ' ';
  while (ch < '0' || ch > '9') {
    if (ch == '-') flag = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  x *= flag;
}
void read(long long &x) {
  x = 0;
  int flag = 1;
  char ch = ' ';
  while (ch < '0' || ch > '9') {
    if (ch == '-') flag = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  x *= flag;
}
using namespace std;
const int maxn = 1010;
int n, ans, a[maxn];
long long w, b, x, sum, cost[maxn], dp[maxn][maxn * 10];
int main() {
  read(n), read(w), read(b), read(x);
  for (int i = 1; i <= (int)n; i++) read(a[i]), sum += a[i];
  for (int i = 1; i <= (int)n; i++) read(cost[i]);
  memset(dp, -1, sizeof(dp));
  dp[0][0] = w;
  for (int i = 1; i <= (int)n; i++)
    for (int j = 0; j <= (int)sum; j++)
      for (int k = 0; k <= (int)min(j, a[i]); k++) {
        if (dp[i - 1][j - k] == -1) continue;
        long long nxt =
            min(w + (j - k) * b, dp[i - 1][j - k] + x) - 1ll * k * cost[i];
        if (nxt < 0) continue;
        dp[i][j] = max(dp[i][j], min(w + j * b, nxt));
        ans = max(ans, j);
      }
  printf("%d\n", ans);
  return 0;
}
