#include <bits/stdc++.h>
using namespace std;
int dx[8] = {0, 0, 1, -1, 1, 1, -1, -1};
int dy[8] = {1, -1, 0, 0, 1, -1, 1, -1};
template <typename T>
inline T BigMod(T A, T B) {
  T ret = 1;
  while (B) {
    if (B & 1) ret = (ret * A) % 1000000007;
    A = (A * A) % 1000000007;
    B = B >> 1;
  }
  return ret;
}
template <typename T>
inline T InvMod(T A, T M = 1000000007) {
  return BigMod(A, M - 2);
}
string tostring(long long int res) {
  string curstr = "";
  while (res != 0) {
    long long int temp = (res % 10);
    curstr += ((char)temp + '0');
    res /= 10;
  }
  reverse(curstr.begin(), curstr.end());
  return curstr;
}
long long int toint(string ss) {
  long long int inss = 0;
  for (int i = 0; i < ss.size(); i++) {
    inss = (inss * 10) + ((int)(ss[i] - '0'));
  }
  return inss;
}
long long int dp[1003][10005], bir[1003], cost[1003];
long long int n, w, b, x;
long long int call() {
  memset(dp, -1, sizeof(dp));
  dp[0][0] = w;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 10005 && dp[i][j] != -1; j++) {
      for (int k = 0; k <= bir[i]; k++) {
        if (dp[i][j] < (k * cost[i])) continue;
        long long int ans =
            min(w + ((j + k) * b), dp[i][j] - (k * cost[i]) + x);
        dp[i + 1][j + k] = max(dp[i + 1][j + k], ans);
      }
    }
  }
  long long int res = 0;
  for (int i = 0; i < 10005; i++) {
    if (dp[n][i] != -1) res = i;
  }
  return res;
}
int main() {
  scanf("%lld %lld %lld %lld", &n, &w, &b, &x);
  for (int i = 0; i < n; i++) scanf("%lld", &bir[i]);
  for (int i = 0; i < n; i++) scanf("%lld", &cost[i]);
  printf("%lld\n", call());
  return 0;
}
