#include <bits/stdc++.h>
using namespace std;
const long long inf = 4e18;
const long long maxn = 1010;
const long long maxc = 10010;
#pragma GCC Optimize("Ofast")
long long c[maxn];
long long cost[maxn];
long long dp[maxn][maxc];
int main() {
  for (long long i = 0; i < maxn; i++)
    for (long long j = 0; j < maxc; j++) dp[i][j] = -1;
  long long n, w, b, x;
  cin >> n >> w >> b >> x;
  for (long long i = 0; i < n; i++) cin >> c[i];
  for (long long i = 0; i < n; i++) cin >> cost[i];
  dp[0][0] = w;
  for (long long i = 1; i <= c[0]; i++) {
    if (dp[0][i - 1] >= cost[0]) dp[0][i] = dp[0][i - 1] - cost[0];
  }
  long long sum = c[0];
  for (long long i = 1; i <= n - 1; i++) {
    dp[i][0] = w;
    sum += c[i];
    for (long long j = 1; j <= sum; j++) {
      for (long long k = 0; k <= c[i]; k++) {
        if (dp[i - 1][j - k] == -1) continue;
        long long num =
            min(dp[i - 1][j - k] + x, w + ((j - k) * b)) - (k * cost[i]);
        if (num >= 0) dp[i][j] = max(dp[i][j], num);
      }
    }
  }
  for (long long i = maxc - 1; i >= 0; i--) {
    if (dp[n - 1][i] != -1) {
      cout << i;
      return 0;
    }
  }
}
