#include <bits/stdc++.h>
using namespace std;
long long int n, W, B, X;
long long int qtd[10101];
long long int cost[10101];
long long int dp[1010][10101];
long long int sum = 0;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> W >> B >> X;
  for (long long int i = 1; i <= n; i++) {
    cin >> qtd[i];
    sum += qtd[i];
  }
  for (long long int i = 1; i <= n; i++) cin >> cost[i];
  for (long long int i = 0; i < 1010; i++) {
    for (long long int j = 0; j < 10101; j++) {
      dp[i][j] = -1000000000000000LL;
    }
  }
  long long int cap, ans = 0;
  for (long long int i = 0; i <= qtd[1]; i++) {
    dp[1][i] = W - i * cost[1];
    if (dp[1][i] < 0) dp[1][i] = -1000000000000000LL;
    if (n == 1 && dp[1][i] >= 0) ans = max(ans, i);
  }
  for (long long int i = 2; i <= n; i++) {
    for (long long int j = 0; j <= sum; j++) {
      dp[i][j] = -1000000000000000LL;
      for (long long int k = 0; k <= min(qtd[i], j); k++) {
        cap = (j - k) * B + W;
        dp[i][j] = max(dp[i][j], min(cap, dp[i - 1][j - k] + X) - k * cost[i]);
      }
      if (dp[i][j] < 0) dp[i][j] = -1000000000000000LL;
      if (i == n) {
        if (dp[i][j] >= 0) ans = max(ans, j);
      }
    }
  }
  cout << ans << "\n";
  return 0;
}
