#include <bits/stdc++.h>
using namespace std;
long long dp[1005][10005];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  memset(dp, 255, sizeof(dp));
  long long n, w, b, x;
  cin >> n >> w >> b >> x;
  vector<long long> v(n);
  vector<long long> cost(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  for (int i = 0; i < n; i++) cin >> cost[i];
  dp[0][0] = w;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= 10000; j++) {
      if (dp[i - 1][j] == -1) continue;
      long long new_mana = min(dp[i - 1][j] + x, w + b * j);
      for (int k = 0; k <= v[i - 1]; k++) {
        if (new_mana < cost[i - 1] * k) break;
        dp[i][j + k] = max(dp[i][j + k], new_mana - cost[i - 1] * k);
      }
    }
  }
  int ans = 0;
  for (int i = 0; i <= 10000; i++)
    if (dp[n][i] != -1) ans = i;
  cout << ans;
}
