#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 5, K = 22, M = 1e4 + 1;
const long long MOD = 1e9 + 7;
const long long INF = 1e15 + 5;
long long n, W, B, X, sum, GR;
long long arr[N], cost[N], pref[N];
long long dp[N][M];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> W >> B >> X;
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
    sum += arr[i];
  }
  for (int i = 1; i < n; ++i) pref[i] = pref[i - 1] + arr[i];
  for (int i = 0; i < n; ++i) cin >> cost[i];
  for (int i = 0; i < N; ++i)
    for (int j = 0; j < M; ++j) dp[i][j] = -INF;
  dp[0][0] = W;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j <= sum; ++j) {
      if (dp[i][j] == -INF) continue;
      for (int k = 0; k <= arr[i] && cost[i] * k <= dp[i][j]; ++k) {
        dp[i + 1][j + k] = max(dp[i + 1][j + k], dp[i][j] - cost[i] * k + X);
        dp[i + 1][j + k] = min(dp[i + 1][j + k], W + (j + k) * B);
      }
    }
  }
  for (int i = sum; i >= 0; --i) {
    if (dp[n][i] != -INF) {
      cout << i;
      return 0;
    }
  }
  cout << 0;
}
