#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e3 + 5, maxm = 1e4 + 5;
int n;
long long w, b, x;
long long dp[maxn][maxm];
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> w >> b >> x;
  vector<int> c(n);
  vector<long long> cost(n);
  for (auto &a : c) cin >> a;
  for (auto &a : cost) cin >> a;
  fill_n(&dp[0][0], maxn * maxm, -1);
  dp[0][0] = w;
  for (int i = 0; i < n; ++i) {
    for (long long j = 0; j < maxm && dp[i][j] != -1; ++j) {
      for (long long k = 0; k <= c[i] && dp[i][j] >= cost[i] * k; ++k)
        dp[i + 1][j + k] = max(
            dp[i + 1][j + k], min(w + (j + k) * b, dp[i][j] - k * cost[i] + x));
    }
  }
  long long ans = 0;
  for (long long i = 0; i < maxm; ++i)
    if (dp[n][i] != -1) ans = max(ans, i);
  cout << ans << endl;
  return 0;
}
