#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define ull unsigned long long
#define ld long double
#define all(x) (x).begin(), (x).end()
#define int long long

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    int n, m, T;
    cin >> n >> m >> T;
    vector<int> a(n);
    int pos = 0;
    for (int i = 0; i < n; i++){
        cin >> a[i];
        if (a[i] < a[pos]) pos = i;
    }
    vector<int> pref(n + 1, 0);
    for (int i = 0; i < n; i++){
        pref[i + 1] = pref[i] + a[i];
    }
    vector<int> cnt(n);
    for (int i = 0; i < n; i++){
        int l, r;
        if (i < pos){
            l = i;
            r = pos - 1;
        }else{
            l = pos + 1;
            r = i;
        }
        int before = pref[r + 1] - pref[l];
        //cout << before << ' ';
        cnt[i] = max(0ll, (T - before)) / a[pos] + (r - l + 1);
    }
    int mx = 0;
    for (int i = 0; i < m; i++){
        int bi;
        cin >> bi;
        mx = max(mx, cnt[bi - 1]);
    }
    cout << mx;
}
