#include <bits/stdc++.h>
using namespace std;
inline void prep() {
  cin.tie(0);
  cin.sync_with_stdio(0);
}
const int MX = 1e5 + 10;
const int mood = ((int)1e9 + 7);
int main() {
  int n, w, b, x;
  scanf("%d %d %d %d", &n, &w, &b, &x);
  std::vector<int> c(n);
  int m = 0;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &c[i]);
    m += c[i];
  }
  std::vector<int> cost(n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &cost[i]);
  }
  long long dp[n + 1][m + 1];
  memset(dp, 0xff, sizeof dp);
  dp[0][0] = w;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j <= m; ++j) {
      if (dp[i][j] != -1) {
        for (int k = 0; k <= c[i] && (k + j) <= m; ++k) {
          long long mana = min(dp[i][j] + x, w + j * 1ll * b);
          mana -= k * 1ll * cost[i];
          if (mana < 0) break;
          dp[i + 1][j + k] = max(dp[i + 1][j + k], mana);
        }
      }
    }
  }
  for (int i = m; i >= 0; --i) {
    if (dp[n][i] >= 0) {
      printf("%d\n", i);
      return 0;
    }
  }
  return 0;
}
