#include <bits/stdc++.h>
using namespace std;
const double pi = 3.141592653589;
const long long int zero = 0;
long long int mod = 998244353;
const long long int inf = 1e9;
const long long int inff = 9000000000000000000;
char al[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
               'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
char capital[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
                    'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
                    'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    int n;
    cin >> n;
    long long int money, cap, profit;
    cin >> money >> cap >> profit;
    int c[n];
    long long int cost[n];
    for (int i = 0; i < n; i += 1) {
      cin >> c[i];
    }
    for (int i = 0; i < n; i += 1) {
      cin >> cost[i];
    }
    int tot = 0;
    long long int dp[n + 1][10001];
    for (int i = 0; i < n + 1; i += 1) {
      for (int j = 0; j < 10001; j += 1) {
        dp[i][j] = -1;
      }
    }
    dp[0][0] = money;
    for (int i = 1; i < n + 1; i += 1) {
      for (int j = 0; j < tot + 1; j += 1) {
        if (dp[i - 1][j] != -1) {
          for (int ii = 0; ii <= c[i - 1]; ii++) {
            dp[i][j + ii] =
                max(dp[i][j + ii], min(dp[i - 1][j] + profit, money + cap * j) -
                                       ii * cost[i - 1]);
          }
        }
      }
      tot += c[i - 1];
    }
    for (int i = 10000; i >= 0; i -= 1) {
      if (dp[n][i] != -1) {
        cout << i;
        break;
      }
    }
  }
}
