//#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
//#pragma GCC target("avx2")
using namespace std;
using ll = int64_t;

void solve() {
    ll n, m, T;
    cin >> n >> m >> T;
    vector<ll> a(n);
    vector<bool> used(n + 1, false);
    for (auto &i : a) {
        cin >> i;
    }
    for (ll i = 0, ind; i < m; ++i) {
        cin >> ind;
        used[ind] = true;
    }
    vector<ll> pref_sum(n + 1, 0);
    for (ll i = 1; i <= n; ++i) {
        pref_sum[i] = pref_sum[i - 1] + a[i - 1];
    }
    vector<ll> close_l(n + 1, 0), close_r(n + 1, n + 1);
    for (ll i = 1, tec = -1; i <= n; ++i) {
        if (used[i]) {
            tec = i;
        }
        if (tec != -1) {
            close_l[i] = tec;
        }
    }
    for (ll i = n, tec = -1; i > 0; --i) {
        if (used[i]) {
            tec = i;
        }
        if (tec != -1) {
            close_r[i] = tec;
        }
    }

    ll ans = 0;

    for (ll i = 1; i <= n; ++i) {
        if (close_l[i] != 0) {
            ll tmp = pref_sum[i - 1] - pref_sum[close_l[i] - 1];
            ans = max(ans, max(0ll, (T - tmp)) / a[i - 1] + (i - close_l[i]));
        }
        if (close_r[i] <= n) {
            ll tmp = pref_sum[close_r[i]] - pref_sum[i];
            ans = max(ans, max(0ll, (T - tmp)) / a[i - 1] + (close_r[i] - i));
        }
    }

    cout << ans << '\n';
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    ll t = 1;
//    cin >> t;
    while (t --> 0) {
        solve();
    }

    return 0;
}
