#include <bits/stdc++.h>
using namespace std;
long long n, w, b, x;
long long c[1005], cost[1005];
long long dp[1005][10005];
int main() {
  cin >> n >> w >> b >> x;
  for (int i = 1; i <= n; i++) cin >> c[i];
  for (int i = 1; i <= n; i++) cin >> cost[i];
  memset(dp, 0x3f3f3f3f3f3f3f3f, sizeof dp);
  dp[0][0] = w;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j <= 10000; j++) {
      long long f = 0, t = 0;
      for (int k = c[i]; k >= 0; k--)
        if (dp[i - 1][j - k] != 0x3f3f3f3f3f3f3f3f && j - k >= 0) {
          long long tt =
              min(dp[i - 1][j - k] + x, w + (j - k) * b) - cost[i] * k;
          if (tt >= 0) {
            f = 1;
            t = max(t, tt);
          }
        }
      if (f) dp[i][j] = t;
    }
  int mx = 0;
  for (int i = 0; i < 10001; i++)
    if (dp[n][i] != 0x3f3f3f3f3f3f3f3f) {
      if (mx < i) mx = i;
    }
  cout << mx << endl;
  return 0;
}
