#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long base = 331;
const int dx[8] = {0, -1, 0, 1, 1, -1, -1, 1};
const int dy[8] = {-1, 0, 1, 0, -1, -1, 1, 1};
const int N = 1005;
int n;
long long W, B, X;
long long c[N], s, cost[N];
long long dp[N][N * 10];
void gogo() {
  cin >> n >> W >> B >> X;
  for (int i = 1; i <= n; ++i) cin >> c[i], s += c[i];
  for (int i = 1; i <= n; ++i) cin >> cost[i];
  memset(dp, -1, sizeof(dp));
  dp[0][0] = W;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j <= s; ++j) {
      if (dp[i][j] == -1) continue;
      for (int k = 0; k <= c[i + 1]; ++k) {
        if (j + k <= s && dp[i][j] >= 1ll * k * cost[i + 1]) {
          dp[i + 1][j + k] = max(
              dp[i + 1][j + k],
              min(W + 1ll * (j + k) * B, dp[i][j] - 1ll * k * cost[i + 1] + X));
        } else
          break;
      }
    }
  }
  int ans = 0;
  for (int i = 0; i <= s; ++i) {
    if (dp[n][i] != -1) ans = max(ans, i);
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  if (fopen("sol"
            ".inp",
            "r")) {
    freopen(
        "sol"
        ".inp",
        "r", stdin);
    freopen(
        "sol"
        ".out",
        "w", stdout);
  }
  gogo();
}
