#include <bits/stdc++.h>
using namespace std;
long long n, w, b, x;
long long dp[1003][10004];
long long bird[1003];
long long cost[1003];
long long totBir = 0;
int main() {
  scanf("%lld%lld%lld%lld", &n, &w, &b, &x);
  memset(dp, -1, sizeof(dp));
  for (long long i = 0; i < n; i++) {
    scanf("%lld", &bird[i]);
    totBir += bird[i];
  }
  for (long long i = 0; i < n; i++) scanf("%lld", &cost[i]);
  for (long long i = 0; i < n; i++) dp[i][0] = w;
  for (long long j = 0; j <= bird[0]; j++) {
    dp[0][j] = max(dp[0][j], w - cost[0] * j);
  }
  for (long long j = 1; j <= totBir; j++) {
    for (long long i = 1; i < n; i++) {
      for (long long k = 0; k <= bird[i]; k++) {
        if ((j - k) < 0 || dp[i - 1][j - k] == -1) continue;
        dp[i][j] = max(
            dp[i][j], min(dp[i - 1][j - k] + x, w + (j - k) * b) - k * cost[i]);
      }
    }
  }
  long long ans = 0;
  for (long long i = 0; i <= totBir; i++) {
    if (dp[n - 1][i] != -1) ans = i;
  }
  printf("%lld\n", ans);
  return 0;
}
