#include <bits/stdc++.h>
using namespace std;
const long long INF = 0x3f3f3f3f;
const int N = 1e4 + 10;
const int M = 1e3 + 10;
const long long mod = 1e9 + 7;
const double PI = acos(-1);
int ab(int x) { return x < 0 ? -x : x; }
long long dp[2][N];
int c[M];
int cost[M];
int main() {
  int n, w, b, x;
  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]);
  int pre = 1, now = 0;
  memset(dp[now], -1, sizeof(dp[now]));
  dp[0][0] = w;
  for (int i = 1; i <= n; ++i) {
    swap(pre, now);
    memset(dp[now], -1, sizeof(dp[now]));
    for (int tmp = 0; tmp <= 10000; ++tmp) {
      if (dp[pre][tmp] == -1) continue;
      for (int add = 0; add <= c[i]; ++add) {
        if (dp[pre][tmp] < add * 1ll * cost[i]) break;
        dp[now][tmp + add] =
            max(dp[now][tmp + add], min(dp[pre][tmp] - add * 1ll * cost[i] + x,
                                        w + (tmp + add) * 1ll * b));
      }
    }
  }
  int ans = 10000;
  while (dp[now][ans] == -1) ans--;
  printf("%d\n", ans);
  return 0;
}
