#include <bits/stdc++.h>
using namespace std;
const int N = 3010;
const long long INF = 1e18;
const int M = 10000;
int n, cost[N], c[N];
long long dp[N][M + 10];
int w, x, b;
int main() {
  scanf("%d%d%d%d", &n, &w, &b, &x);
  for (int i = 1; i <= n; i++) scanf("%d", &c[i]);
  for (int i = 1; i <= n; i++) scanf("%d", &cost[i]);
  for (int i = 1; i <= M; i++) dp[0][i] = -INF;
  dp[0][0] = w;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= M; j++) {
      dp[i][j] = -INF;
      for (int k = 0; k <= min(j, c[i]); k++) {
        dp[i][j] =
            max(dp[i][j], min(dp[i - 1][j - k] + x, 1ll * b * (j - k) + w) -
                              1ll * k * cost[i]);
      }
      if (dp[i][j] < 0) dp[i][j] = -INF;
    }
  }
  int ans = 0;
  for (int i = 1; i <= M; i++) {
    if (dp[n][i] != -INF) ans = i;
  }
  cout << ans;
  return 0;
}
