#include <bits/stdc++.h>
using namespace std;
const long long inf = (long long)1e9 + 10;
const long long linf = (long long)1e18 + 10;
const long long mod = (long long)(1e9 + 7);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};
const double eps = 1e-10;
struct oreno_initializer {
  oreno_initializer() {
    cin.tie(0);
    ios::sync_with_stdio(0);
  }
} oreno_initializer;
long long n, W, B, X, c[1000], cost[1000], dp[1001][10001], sum;
signed main() {
  cin >> n >> W >> B >> X;
  for (int(i) = (0); (i) < (n); ++(i)) cin >> c[i];
  for (int(i) = (0); (i) < (n); ++(i)) cin >> cost[i];
  memset(dp, -1, sizeof(dp));
  dp[0][0] = W;
  for (int(i) = (0); (i) < (n); ++(i)) {
    for (int(j) = (0); (j) < (((sum) + 1)); ++(j)) {
      if (dp[i][j] == -1) continue;
      for (int(k) = (0); (k) < (((c[i]) + 1)); ++(k)) {
        long long tmp = dp[i][j] - (long long)k * cost[i];
        if (tmp < 0) break;
        tmp += X;
        tmp = min(tmp, W + (long long)(j + k) * B);
        dp[i + 1][j + k] = max(dp[i + 1][j + k], tmp);
      }
    }
    sum += c[i];
  }
  for (int(i) = (10000); (i) >= (0); --(i))
    if (dp[n][i] >= 0) return cout << i << '\n', 0;
}
