#include <bits/stdc++.h>
using namespace std;
long long dp[1005][10008], n, W, B, X, c[1008], cost[1003];
int main() {
  memset(dp, -1, sizeof(dp));
  scanf("%lld%lld%lld%lld", &n, &W, &B, &X);
  for (int i = 1; i <= n; ++i) scanf("%lld", c + i);
  for (int i = 1; i <= n; ++i) scanf("%lld", cost + i);
  for (int i = 0; i <= c[1]; ++i) {
    if (W >= cost[1] * i)
      dp[1][i] = W - cost[1] * i;
    else
      break;
  }
  for (int i = 2; i <= n; ++i) {
    for (int j = 0; j <= 10000; ++j)
      if (dp[i - 1][j] != -1)
        dp[i - 1][j] =
            dp[i - 1][j] + X >= (W + B * j) ? (W + B * j) : (dp[i - 1][j] + X);
      else
        break;
    for (int j = 0; j <= 10000; ++j)
      if (dp[i - 1][j] != -1) {
        for (int k = 0; k <= c[i]; ++k)
          if (dp[i - 1][j] >= cost[i] * k)
            dp[i][j + k] = max(dp[i][j + k], dp[i - 1][j] - cost[i] * k);
      } else
        break;
  }
  int i;
  for (i = 10000; i; --i)
    if (dp[n][i] != -1) break;
  printf("%d\n", i);
}
