#include <bits/stdc++.h>
using namespace std;
int n, T, ans;
long long W, B, R;
int mons[1005];
long long cost[1005];
long long DP[1005][10005];
int main() {
  cin >> n >> W >> B >> R;
  for (int i = 1; i <= n; i++) cin >> mons[i];
  for (int i = 1; i <= n; i++) cin >> cost[i];
  memset(DP, -1, sizeof(DP));
  DP[0][0] = W;
  for (int i = 1; i <= n; i++) {
    T += mons[i];
    for (int j = 0; j <= T; j++) {
      for (int k = 0; k <= mons[i]; k++) {
        if (DP[i - 1][j - k] != -1) {
          DP[i][j] = max(DP[i][j], (min(DP[i - 1][j - k] + R, W + (j - k) * B) -
                                    cost[i] * k));
        }
      }
      if (i == n && DP[i][j] != -1) ans = j;
    }
  }
  cout << ans;
}
