#include <iostream>
#include <vector>

using namespace std;

typedef long long int ll;

int main() {
    int n;
	cin >> n;
	
	
    vector<ll> req(n);
    vector<ll> stock(n);
    vector<ll> cost(n);
    ll budget;

    for (int i = 0; i < n; i++) {
        cin >> req[i];
    }

    for (int i = 0; i < n; i++) {
        cin >> stock[i];
    }

    for (int i = 0; i < n; i++) {
        cin >> cost[i];
    }

    // Total budget
    cin >> budget;

    ll i = 1;
    ll answer = 0;
    bool stop = false;

    // Linear search to find maximum possible items 'i'
    while (!stop) {
        ll sum = 0;

        for (int j = 0; j < n; j++) {
            ll req_amount = req[j] * i;
            ll need = req_amount - stock[j];

            if (need > 0) {
                sum += need * cost[j];
            }
        }

        if (sum <= budget) {
            answer = i;
            i++; // Move to next count to test
        } else {
            stop = true; // Budget exceeded
        }
    }

    cout << "Answer: " << answer << "\n";

    return 0;
}