//#pragma GCC optimize("O3,unroll-loops")
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

constexpr ll INF = 1e18;

ll better(ll i, ll j, ll v, vector<ll> &pref, vector<ll> &a) {
    return ((pref[j + 1] - pref[i + 1]) * a[j] - (j - i) * a[i] * a[j] - 1) / (a[j] - a[i]) + 1 + pref[v + 1] - pref[j + 1];
}

ll calc(ll i, ll v, vector<ll> &pref, vector<ll> &a, ll t) {
    return (t - (pref[v + 1] - pref[i + 1])) / a[i] + v - i;
}

void solve_left(ll n, vector<ll> &a, vector<ll> &dp, ll t) {
    vector<ll> pref(n + 1);
    pref[0] = 0;
    for (ll i = 1; i <= n; ++i) {
        pref[i] = pref[i - 1] + a[i - 1];
    }

    vector<ll> st;
    ll plus = 0;
    for (ll i = 0; i < n; ++i) {
        while (!st.empty() && (a[st.back()] >= a[i] || (st.size() > 1 &&
                better(st.back(), i, i, pref, a) >= better(st[st.size() - 2], st.back(), i, pref, a)))) {
            st.pop_back();
        }
        st.push_back(i);

//        cout << i << "   ";
//        for (ll j = 0; j < st.size(); ++j) {
//            cout << st[j] << ' ';
//            if (j < st.size() - 1) {
//                cout << better(j, j + 1, i, pref, a) << "  ";
//            }
//        }

        ll l = 0, r = ll(st.size());
        while (r - l > 1) {
            ll m = (l + r) / 2;
            if (t >= better(st[m - 1], st[m], i, pref, a)) {
                r = m;
            } else {
                l = m;
            }
        }
        dp[i] = calc(st[l], i, pref, a, t);

//        cout << "   " << dp[i] << '\n';
    }
}

void solve() {
    ll n, m, t;
    cin >> n >> m >> t;
    vector<ll> a(n);
    for (ll i = 0; i < n; ++i) {
        cin >> a[i];
    }

    vector<ll> dpl(n), dpr(n);
//    cout << "l:\n";
    solve_left(n, a, dpl, t);
    reverse(a.begin(), a.end());
//    cout << "r:\n";
    solve_left(n, a, dpr, t);
    reverse(dpr.begin(), dpr.end());
    ll ans = 0;
    for (ll i = 0; i < m; ++i) {
        ll v;
        cin >> v;
        v--;
        ans = max(ans, max(dpl[v], dpr[v]));
    }
    cout << ans << '\n';
}

signed main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    ll t = 1;
    //cin >> t;
    while (t--) {
        solve();
    }
}
