#include <bits/stdc++.h>
using namespace std;
const int maxn = 1005, mod = 1000000007;
long long dp[maxn][10004], tmp[10005];
long long cost[maxn], c[maxn];
long long n, W, B, X;
int main() {
  cin >> n >> W >> B >> X;
  for (int i = 1; i < (n + 1); ++i) scanf("%lld", &c[i]);
  for (int i = 1; i < (n + 1); ++i) scanf("%lld", &cost[i]);
  memset(dp, -1, sizeof(dp));
  dp[0][0] = W;
  int tot = 0, ans = 0;
  for (int i = 1; i < (n + 1); ++i) {
    for (int pre = 0; pre < (tot + 1); ++pre)
      for (int j = 0; j < (c[i] + 1); ++j) {
        if (cost[i] * j > dp[i - 1][pre]) break;
        dp[i][pre + j] =
            max(dp[i][pre + j],
                min(W + B * (pre + j), X + (dp[i - 1][pre] - cost[i] * j)));
        ans = max(ans, pre + j);
      }
    tot += c[i];
  }
  for (int i = 10000; i >= 0; --i)
    if (dp[n][i] != -1) {
      cout << i << endl;
      return 0;
    }
}
