#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 5, M = 1e4 + 5;
;
int cnt[N];
long long dp[N][M], cost[N];
int n;
long long w, b, x;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> w >> b >> x;
  for (int i = 1; i <= n; i++) {
    cin >> cnt[i];
  }
  for (int i = 1; i <= n; i++) {
    cin >> cost[i];
  }
  memset(dp, -1, sizeof(dp));
  dp[1][0] = w;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < M && dp[i][j] != -1; j++) {
      for (int k = 0; k <= cnt[i] && dp[i][j] - cost[i] * k >= 0; k++) {
        dp[i + 1][j + k] = max(
            dp[i + 1][j + k], min(dp[i][j] - cost[i] * k + x, w + (k + j) * b));
      }
    }
  }
  long long ans = 0;
  for (int i = 0; i < M; i++) {
    if (dp[n + 1][i] != -1) {
      ans = i;
    }
  }
  cout << ans;
  return 0;
}
