#include <bits/stdc++.h>
using namespace std;
long long n, w, b, x, c[1005], cost[1005], m, dp[1005][1005 * 10];
int main() {
  scanf("%d%d%d%d", &n, &w, &b, &x);
  for (int i = (1); i <= (n); ++i) scanf("%d", &c[i]), m += c[i];
  for (int i = (1); i <= (n); ++i) scanf("%d", &cost[i]);
  for (int i = (0); i <= (n); ++i)
    for (int j = (0); j <= (m); ++j) dp[i][j] = -1000000007;
  dp[0][0] = w;
  for (int i = (1); i <= (n); ++i)
    for (int j = (0); j <= (m); ++j) {
      long long qwe = 1ll * j * b + w;
      for (int k = (0); k <= (min(1ll * j, c[i])); ++k)
        if (dp[i - 1][j - k] >= 0) {
          long long temp =
              min(1ll * (j - k) * b + w, dp[i - 1][j - k] + x) - cost[i] * k;
          if (temp >= 0) {
            dp[i][j] = max(dp[i][j], min(qwe, temp));
            qwe += b;
          }
        }
    }
  for (int i = (m); i >= (0); --i)
    if (dp[n][i] >= 0) {
      printf("%d", i);
      return 0;
    }
}
