#include <bits/stdc++.h>
using namespace std;
long long int n, dp[2][11000], w, b, x, num[1100], cost[1100], sum = 0;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> w >> b >> x;
  for (int i = 1; i <= n; i++) {
    cin >> num[i];
    sum += num[i];
  }
  for (int i = 1; i <= n; i++) cin >> cost[i];
  for (int i = 1; i <= sum; i++) dp[0][i] = dp[1][i] = -1;
  dp[0][0] = w;
  int maxim = 0;
  for (int i = 1; i <= n; i++) {
    for (long long int j = 1; j <= num[i]; j++) {
      for (long long int k = j; k <= sum; k++) {
        if (dp[0][k - j] != -1) {
          long long int cap = w + (k - j) * b;
          long long int remain = min(dp[0][k - j] + x, cap);
          if (remain >= j * cost[i]) {
            if (dp[1][k] == -1)
              dp[1][k] = (remain - j * cost[i]);
            else
              dp[1][k] = max(dp[1][k], (remain - j * cost[i]));
          }
        }
      }
    }
    for (int j = 0; j <= sum; j++) {
      if (dp[1][j] != -1 and dp[0][j] != -1) {
        dp[0][j] = max(dp[1][j], dp[0][j] + x);
      } else if (dp[1][j] != -1)
        dp[0][j] = dp[1][j];
      else if (dp[0][j] != -1)
        dp[0][j] += x;
      if (i == 1 and j == 0) dp[0][0] -= x;
      if (dp[0][j] != -1) maxim = max(maxim, j);
      dp[1][j] = -1;
    }
  }
  cout << maxim << "\n";
}
