#ifndef SEREGA
#include <bits/allocator.h>
#pragma GCC target("avx2,popcnt")
#pragma GCC optimize("O3,no-stack-protector")
#endif
#include <bits/stdc++.h>
using namespace std;
#define int int64_t

void solve() {
    int n, m, T;
    cin >> n >> m >> T;
    vector<int> a(n + 2);
    vector<int> pref(n + 1);
    vector<int> answers(n + 1);
    auto get = [&pref,&a,T](int i, int j) -> int {
        if (j <= i) {
            if (pref[i] - pref[j] <= T) {
                return (T - (pref[i] - pref[j])) / a[j] + (i - j);
            }
        } else {
            if (pref[j - 1] - pref[i - 1] <= T) {
                return (T - (pref[j - 1] - pref[i - 1])) / a[j] + (j - i);
            }
        }
        return INT_MIN;
    };
    for (int i = 1; i <= n; ++i) {
        cin >> a[i];
        pref[i] = pref[i - 1] + a[i];
    }
    for (int i = 1; i <= n; ++i) {
        answers[i] = get(i, i);
    }
    vector<int> leftleast(n + 1);
    vector<int> st = {0};
    a[0] = INT_MIN;
    for (int i= 1; i <= n; ++i) {
        while (a[st.back()] >= a[i]) st.pop_back();
        leftleast[i] = st.back();
        st.push_back(i);
    }
    st = {n + 1};
    a[n + 1] = INT_MIN;
    vector<int> rightleast(n + 1);
    for (int i = n; i >= 1; --i) {
        while (a[st.back()] >= a[i]) st.pop_back();
        rightleast[i] = st.back();
        st.push_back(i);
    }
    vector<int> nlmin(n + 1);
    vector<int> nrmin(n + 1);
    vector<int> yal(n + 1, INT_MIN); 
    vector<int> yar(n + 1, INT_MIN); 
    
    
   
    vector<int> dq = {0};
    for (int i =1 ; i<= n; ++i) {
        for (int j = 0; j < min<int>(dq.size() -1 , 100); ++j) {
            yal[i] = max(yal[i], get(i, dq[j]));
        }
        while (a[dq.back()] > a[i]) {
            dq.pop_back();
        }
        dq.push_back(i);
    }
    dq = {n + 1};
    for (int i =n ; i>= 1;--i) {
        for (int j = 0; j < min<int>(dq.size() - 1, 100); ++j) {
            yar[i] = max(yar[i], get(i, dq[j]));
        }
        while (a[dq.back()] > a[i]) {
            dq.pop_back();
        }
        dq.push_back(i);
    }
    a[0] = int(1e18);
    a[n + 1] = int(1e18);
    int mn = INT_MAX;
    int mnindex = 0;
    for (int i = 1; i <= n; ++i) {
        nlmin[i] = mnindex;
        if (a[i] <= mn) {
            mnindex = i;
            mn = a[i];
        }
    }
    mn = INT_MAX;
    mnindex = n + 1;
    for (int i = n; i >= 1; --i) {
        nrmin[i] = mnindex;
        if (a[i] <= mn) {
            mnindex = i;
            mn = a[i];
        }
    }
    mt19937 rng(781);
    #define uid(x,y) uniform_int_distribution<int>(x, y)(rng)
    for (int i = 1; i<= n; ++i) {
        // cout << nlmin[i] << ' ' << nrmin[i] << ' ' << leftleast[i] << ' ' << rightleast[i] << endl;
        if (nlmin[i] > 0) {
            answers[i] = max(answers[i], get(i, nlmin[i]));
        }
        if (nrmin[i] <= n) {
            answers[i] = max(answers[i], get(i, nrmin[i]));
        }
        if (leftleast[i] > 0) {
            answers[i] = max(answers[i], get(i, leftleast[i]));
        }
        if (rightleast[i] <= n) {
            answers[i] = max(answers[i], get(i, rightleast[i]));
        }
        answers[i] = max(answers[i], yal[i]);
        answers[i] = max(answers[i], yar[i]);
        answers[i] = max(answers[i], get(i, 1));
        answers[i] = max(answers[i], get(i, n));
        answers[i] = max(answers[i], get(i, i));
        
        
        
    }
    int mx = INT_MIN;
    for (int i = 0; i < m; ++i) {
        int b;
        cin >> b;
        mx = max(mx, answers[b]);
    }
    cout << mx << endl;

}

signed main() {
    cin.tie(nullptr)->sync_with_stdio(false);
    int t = 1;
    // cin >> t;
    while (t--) solve();
}