#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
template <class T>
inline void rd(T &x) {
  char c = getchar();
  int s = 1;
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  if (c == '-')
    s = -1, x = 0;
  else
    x = c - '0';
  while (c = getchar(), c >= '0' && c <= '9') x = x * 10 + c - '0';
  x *= s;
}
long long c[2002], cost[2002];
long long dp[1005][10005];
int main() {
  long long n, w, b, x, i;
  rd(n);
  rd(w);
  rd(b);
  rd(x);
  for (i = 0; i < n; i++) rd(c[i]);
  for (i = 0; i < n; i++) rd(cost[i]);
  memset(dp, -1, sizeof(dp));
  dp[0][0] = w;
  long long j, k;
  for (i = 0; i < n; i++) {
    for (j = 0; j < 10005 && dp[i][j] != -1; j++)
      for (k = 0; k <= c[i] && dp[i][j] >= k * cost[i]; k++)
        dp[i + 1][k + j] = max(
            dp[i + 1][k + j], min(w + (k + j) * b, dp[i][j] - k * cost[i] + x));
  }
  long long ans = 0;
  for (i = 0; i < 10005; i++)
    if (~dp[n][i]) ans = max(ans, i);
  printf("%lld\n", ans);
}
