#include <bits/stdc++.h>
using namespace std;
const long long maxN = 1e18;
const long long minN = -1e18;
const int INF = 2e9;
const long long MOD = 1e9 + 7;
const long long MOD1 = 998244353;
const int baseHash = 331;
const int bigNumLength = 5000;
const long double PI = acos(-1);
const long long limit = 2e5 + 5;
const long long limit1 = 1e6 + 5;
const long long limit2 = 1e3 + 5;
pair<int, int> dir[] = {{0, 1}, {1, 0},  {0, -1}, {-1, 0},
                        {1, 1}, {1, -1}, {-1, 1}, {-1, -1}};
pair<int, int> NON = {-1, -1};
long long n, initial, expand, regen;
long long bird[limit], cost[limit];
long long f[limit2][10005];
void solveProblem() {
  for (int i = (1); i <= (n); ++i)
    for (int j = (0); j <= (10000); ++j) f[i][j] = -1e15;
  for (int i = (0); i <= (bird[1]); ++i) {
    f[1][i] = initial - cost[1] * i;
    if (f[1][i] < 0) continue;
    f[1][i] += regen;
    f[1][i] = min(f[1][i], expand * i + initial);
  }
  int curBird = bird[1];
  for (int i = (2); i <= (n); ++i) {
    for (int j = (0); j <= (curBird + bird[i]); ++j) {
      for (int k = (0); k <= (bird[i]); ++k) {
        if (j >= k && j - k <= curBird) {
          long long ans = f[i - 1][j - k] - cost[i] * k;
          if (ans < 0) continue;
          ans += regen;
          ans = min(ans, expand * j + initial);
          f[i][j] = max(f[i][j], ans);
        }
      }
    }
    curBird += bird[i];
  }
  int ans = 0;
  for (int i = (0); i <= (10000); ++i) ans = (f[n][i] >= 0 ? i : ans);
  cout << ans << '\n';
}
void fastInput() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
void readInput() {
  cin >> n >> initial >> expand >> regen;
  for (int i = (1); i <= (n); ++i) cin >> bird[i];
  for (int i = (1); i <= (n); ++i) cin >> cost[i];
}
int main() {
  fastInput();
  readInput();
  solveProblem();
}
