#include <bits/stdc++.h>
#define int int64_t
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
using namespace std;



signed main() {
    int n, m, t; cin >> n >> m >> t;

    vector<int> a(n), b(m), pref(n + 1);

    for (int &i : a)
        cin >> i;
    for (int &i : b)
        cin >> i, i--;

    for (int i = 0; i < n; i++)
        pref[i + 1] = pref[i] + a[i];

    int res = 0;

    for (int st = 0; st < n; st++) {
        int cur_res = 0;

        for (int i = 0; i < m; i++) {
            if (b[i] > st) {
                int cur = t - (pref[b[i] + 1] - pref[st + 1]);

                if (cur >= 0) {
                    cur_res = max(cur_res, (b[i] - st) * a[st] + cur);
                }
            } else {
                int cur = t - (pref[st] - pref[b[i]]);

                if (cur >= 0) {
                    cur_res = max(cur_res, (st - b[i]) * a[st] + cur);
                }
            }
        }

        res = max(res, cur_res / a[st]);
    }


    cout << res;
}