#include<bits/stdc++.h>
#define fast_io ios_base::Synnc_with_stdio(0); cin.tie(0); cout.tie(0);
#define F first
#define S second
#define pb push_back

typedef long long ll;
using namespace std;
#define int ll
const int N = 3e5+100;
int a[N], u[N], pref[N];

int nxt[N];

int get(int l, int r){
    return pref[r]-pref[l-1];
}

int32_t main()
{
    #ifdef ROADTOBELEGEND
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif // ROADTOBELEGEND


    int n,m,T;
    cin>>n>>m>>T;


    for(int i=1;i<=n;++i)
        cin>>a[i];

    for(int i=1;i<=n;++i)
        pref[i]=pref[i-1]+a[i];


    for(int i=1;i<=m;++i)
    {
        int x;
        cin>>x;
        u[x]=1;
    }


    int lst=-1;
    for(int i=n;i>=1;--i)
    {
        if(u[i])lst=i;
        nxt[i]=lst;
    }

    lst=-1;

    int ans=0;

    for(int i=1;i<=n;++i)
    {
        if(u[i])lst=i;

        int ps=lst;
        if(ps!=-1)
        {
            int S=get(ps,i);
            if(S<=T)
            {
                ans=max(ans,i-ps+1+(T-S)/a[i]);
            }
        }
        ps=nxt[i];
        if(ps!=-1)
        {
            int S=get(i,ps);
            if(S<=T)
            {
                ans=max(ans,ps-i+1+(T-S)/a[i]);
            }
        }
    }

    cout<<ans;


    return 0;
}
