#include <iostream>
#include <vector>
#include <algorithm>
#define int long long
using namespace std;

signed main()
{
    int m, n, t;
    cin >> n >> m >> t;
    vector<int> a(n);
    vector<bool> b(n);
    for(int &x : a) cin >> x;
    for(int i = 0; i < m; ++i){
        int x;
        cin >> x;
        b[x - 1] = 1;
    }
    int ans = 0;
    int sum = t, cnt = 0;
    for(int i = 0; i < n; ++i){
        if(b[i]){
            sum = 0;
            cnt = 0;
        }
        sum += a[i];
        ++cnt;
        if(sum <= t) ans = max(ans, cnt + (t - sum)/a[i]);
    }
    sum = t;
    cnt = 0;
    for(int i = n - 1; i >= 0; --i){
        if(b[i]){
            sum = 0;
            cnt = 0;
        }
        sum += a[i];
        ++cnt;
        if(sum <= t) ans = max(ans, cnt + (t - sum)/a[i]);
    }
    cout << ans << endl;
}