#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int main() {
#ifdef home
    freopen("f.in", "r", stdin);
    freopen("f.out", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n, m, t;
    cin >> n >> m >> t;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    vector<ll> pref(n + 1);
    for (int i = 0; i < n; i++) {
        pref[i + 1] = pref[i] + a[i];
    }
    vector<bool> is(n);
    for (int i = 0; i < m; i++) {
        int b;
        cin >> b;
        b--;
        is[b] = true;
    }
    int ans = 0;
    for (int i = 0; i < n; i++) {
        if (is[i]) {
            ans = max(ans, t / a[i]);
        }
    }
    int lst = -1;
    for (int i = 0; i < n; i++) {
        if (is[i]) {
            lst = i;
        } else if (lst != -1 && t - (pref[i] - pref[lst]) >= 0) {
            ans = max(ans, (int) (t - (pref[i] - pref[lst])) / a[i] + i - lst);
        }
    }
    lst = n;
    for (int i = n - 1; i >= 0; i--) {
        if (is[i]) {
            lst = i;
        } else if (lst != n && t - (pref[lst + 1] - pref[i + 1]) >= 0) {
            ans = max(ans, (int) (t - (pref[lst + 1] - pref[i + 1])) / a[i] + lst - i);
        }
    }
    cout << ans << '\n';
    return 0;
}
