#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e17;
long long n, w, b, x;
long long c[1005];
long long cost[1005];
long long f[1005][20005];
int main() {
  srand(time(0));
  ios_base::sync_with_stdio(0);
  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];
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j <= 10000; j++) {
      f[i][j] = -1;
    }
  }
  for (long long i = 0; i <= c[0]; i++) {
    if (w >= i * cost[0])
      f[0][i] = w - cost[0] * i;
    else
      f[0][i] = -1;
  }
  for (long long i = 0; i < n - 1; i++) {
    for (long long j = 0; j <= 10000; j++) {
      for (long long k = 0; k <= c[i + 1]; k++) {
        if (f[i][j] != -1 && min(f[i][j] + x, w + j * b) >= k * cost[i + 1]) {
          f[i + 1][j + k] = max(f[i + 1][j + k],
                                min(f[i][j] + x, w + j * b) - k * cost[i + 1]);
        }
      }
    }
  }
  long long mx = 0;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j <= 10000; j++) {
      if (f[i][j] >= 0) mx = max(mx, j);
    }
  }
  cout << mx;
  return 0;
}
