#include <bits/stdc++.h>

using namespace std;

#define int int64_t
#define pb push_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define ld long double

const int maxn = 2e5;
const int LOG = 30;
const int N = 2e3;
const ld eps = 1e-12;

inline void solve() {
    int n, m, T;
    cin >> n >> m >> T;
    vector<int> a(n);
    vector<int> b(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    for(int i = 0; i < m; i++) {
        int x;
        cin >> x;
        x--;
        b[x] = 1;
    }
    int ans = 0;
    for(int i = 0; i < n; i++) {
        if(a[i] > T) continue;
        if(b[i] == 1) {
            ans = max(ans, T / a[i]);
            int t = T - a[i];
            int res = 1;
            for(int j = i + 1; j < n; j++) {
                if(b[j] || a[j] > t) break;
                ans = max(ans, res + t / a[j]);
                t -= a[j];
                res += 1;
            }
            t = T - a[i];
            res = 1;
            for(int j = i - 1; j > -1; j--) {
                if(b[j] || a[j] > t) break;
                ans = max(ans, res + t / a[j]);
                t -= a[j];
                res += 1;
            }
        }
    }
    cout << ans << '\n';
    return;
}

int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int tt = 1;
    //cin >> tt;

#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    while (tt--) {
        solve();
    }
    return 0;
}
