#include <bits/stdc++.h>
#include <immintrin.h>

#pragma GCC target("avx,avx2")

using namespace std;

#ifndef lisie_bimbi
#define endl '\n'
#endif

using ll = long long;

const ll inf = 1'000'000'000;

random_device rd;

#define int long long

mt19937 rnd(rd());

vector<ll> p;

ll get(int l, int r){
    return p[r] - p[l];
}

void solve(){
    int n, m, t;
    cin >> n >> m >> t;
    vector<int> a(n);
    int mn = inf;
    for(int i = 0; i < n; i++){
        cin >> a[i];
        mn = min(mn, a[i]);
    }
    p.resize(n + 1);
    for(int i = 0; i < n; i++){
        p[i + 1] = p[i] + a[i];
    }
    vector<int> used(n);
    for(int i = 0; i < m; i++){
        int x;
        cin >> x;
        x--;
        used[x] = 1;
    }
    int ans = 0;
    vector<int> left(n, -1), right(n, n);
    for(int i = 0; i < n; i++){
        if(used[i]){
            left[i] = i;
        }else if(i != 0){
            left[i] = left[i - 1];
        }
    }
    for(int i = n - 1; i >= 0; i--){
        if(used[i]){
            right[i] = i;
        }else if(i != n - 1){
            right[i] = right[i + 1];
        }
    }
    for(int i = 0; i < n; i++){
        if(left[i] != -1){
            ll t2 = t - get(left[i], i);
            if(t2 > 0){
                ans = max(ans, i - left[i] + (t2 / a[i]));
            }
        }
        if(right[i] != n){
            ll t2 = t - get(i + 1, right[i] + 1);
            if(t2 > 0){
                ans = max(ans, right[i] - i + (t2 / a[i]));
            }
        }
    }
    cout << ans << endl;
}

signed main(){
#ifdef lisie_bimbi
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    cin.tie(nullptr)->sync_with_stdio(false);
#endif            
    int t = 1;
    //cin >> t;
    while(t--){
        solve();
    }
}