#include <bits/stdc++.h>

using namespace std;

#define int long long

signed main()
{
    int n, m, t;
    cin>>n>>m>>t;

    vector<int> a(n);
    for(int i=0; i<n; ++i){
        cin>>a[i];
    }

    vector<bool> b(n, 0);
    for(int i=0; i<m; ++i){
        int x;
        cin>>x;
        --x;
        b[x]=1;
    }


    vector<pair<int, int>> d(n, {0, 0});
    vector<pair<int, int>> ans(n, {0, 0});

    if(b[0] && t/a[0]>0){

        d[0].first=t/a[0];
        d[0].second=t%a[0];
        ans[0].first=t/a[0];
        ans[0].second=t%a[0];
    }
    for(int i=1; i<n; ++i){
        if(b[i] && t/a[i]>0){
            d[i].first=t/a[i];
            d[i].second=t%a[i];
            ans[i].first=t/a[i];
            ans[i].second=t%a[i];
        }



        if(d[i-1].first>0){
            if(ans[i-1].first - (d[i-1].first-1) +(ans[i-1].second+a[i-1]*(d[i-1].first-1))/a[i] > ans[i].first && (ans[i-1].second+a[i-1]*(d[i-1].first-1))/a[i]>0){
                ans[i].first=ans[i-1].first - (d[i-1].first-1) +(ans[i-1].second+a[i-1]*(d[i-1].first-1))/a[i];
                ans[i].second=(ans[i-1].second+a[i-1]*(d[i-1].first-1))%a[i];
                d[i].first=(ans[i-1].second+a[i-1]*(d[i-1].first-1))/a[i];
                d[i].second=(ans[i-1].second+a[i-1]*(d[i-1].first-1))%a[i];
            }else if(ans[i-1].first - (d[i-1].first-1) +(ans[i-1].second+a[i-1]*(d[i-1].first-1))/a[i] == ans[i].first && (ans[i-1].second+a[i-1]*(d[i-1].first-1))%a[i] > ans[i].second && (ans[i-1].second+a[i-1]*(d[i-1].first-1))/a[i]>0){
                ans[i].first=ans[i-1].first - (d[i-1].first-1) +(ans[i-1].second+a[i-1]*(d[i-1].first-1))/a[i];
                ans[i].second=(ans[i-1].second+a[i-1]*(d[i-1].first-1))%a[i];
                d[i].first=(ans[i-1].second+a[i-1]*(d[i-1].first-1))/a[i];
                d[i].second=(ans[i-1].second+a[i-1]*(d[i-1].first-1))%a[i];
            }
        }
    }

    /*for(int i=0; i<n; ++i){
        cout<<ans[i].first<<" "<<ans[i].second<<"   ";
    }cout<<endl;
    for(int i=0; i<n; ++i){
        cout<<d[i].first<<" "<<d[i].second<<"   ";
    }cout<<endl;*/

    int ansg=0;
    for(int i=0; i<n; ++i){
        ansg=max(max(ansg, ans[i].first), d[i].first);
    }

    d.assign(n, {0, 0});
    ans.assign(n, {0, 0});

    if(b[n-1] && t/a[n-1]>0){
        d[n-1].first=t/a[n-1];
        d[n-1].second=t%a[n-1];
        ans[n-1].first=t/a[n-1];
        ans[n-1].second=t%a[n-1];
    }
    for(int i=n-2; i>=0; --i){
        if(b[i] && t/a[i]>0){
            d[i].first=t/a[i];
            d[i].second=t%a[i];
            ans[i].first=t/a[i];
            ans[i].second=t%a[i];
        }



        if(d[i+1].first>0){
            if(ans[i+1].first - (d[i+1].first-1) +(ans[i+1].second+a[i+1]*(d[i+1].first-1))/a[i] > ans[i].first && (ans[i+1].second+a[i+1]*(d[i+1].first-1))/a[i]>0){
                ans[i].first=ans[i+1].first - (d[i+1].first-1) +(ans[i+1].second+a[i+1]*(d[i+1].first-1))/a[i];
                ans[i].second=(ans[i+1].second+a[i+1]*(d[i+1].first-1))%a[i];
                d[i].first=(ans[i+1].second+a[i+1]*(d[i+1].first-1))/a[i];
                d[i].second=(ans[i+1].second+a[i+1]*(d[i+1].first-1))%a[i];
            }else if(ans[i+1].first - (d[i+1].first-1) +(ans[i+1].second+a[i+1]*(d[i+1].first-1))/a[i] == ans[i].first && (ans[i+1].second+a[i+1]*(d[i+1].first-1))%a[i] > ans[i].second && (ans[i+1].second+a[i+1]*(d[i+1].first-1))/a[i]>0){
                ans[i].first=ans[i+1].first - (d[i+1].first-1) +(ans[i+1].second+a[i+1]*(d[i+1].first-1))/a[i];
                ans[i].second=(ans[i+1].second+a[i+1]*(d[i+1].first-1))%a[i];
                d[i].first=(ans[i+1].second+a[i+1]*(d[i+1].first-1))/a[i];
                d[i].second=(ans[i+1].second+a[i+1]*(d[i+1].first-1))%a[i];
            }
        }
    }

    for(int i=0; i<n; ++i){
        ansg=max(max(ansg, ans[i].first), d[i].first);
    }

    cout<<ansg;
}
