#include <bits/stdc++.h>
using namespace std;
const long long N = 10011;
long long memo[1010][N];
bool vis[1010][N];
long long con[N];
long long costo[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.precision(10);
  cout << fixed;
  long long n, W, B, X;
  cin >> n >> W >> B >> X;
  for (long long i = 1; i <= n; i++) {
    cin >> con[i];
  }
  for (long long i = 1; i <= n; i++) {
    cin >> costo[i];
  }
  long long ans = 0;
  vis[0][0] = true;
  memo[0][0] = W;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j <= con[i]; j++) {
      for (long long k = 0; k <= 10000; k++) {
        if (vis[i - 1][k]) {
          long long queda = memo[i - 1][k] - j * costo[i];
          if (queda >= 0) {
            memo[i][j + k] =
                max(memo[i][j + k], min(queda + X, memo[0][0] + (j + k) * B));
            vis[i][j + k] = true;
            ans = max(ans, j + k);
          }
        } else {
          break;
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}
