#include <bits/stdc++.h>
#define int long long
using namespace std;

const int N = 5e5 + 22;
int n, m, T, a[N];
bool ex[N];

int32_t main() {
    cin.tie(0); cout.tie(0); ios::sync_with_stdio(0);
    cin >> n >> m >> T;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= m; i++) {int x; cin >> x; ex[x] = 1;}

    int ans = 0, cur = 0, prev = 0;
    for (int i = 1; i <= n; i++) {
        if (prev == 0 || T / a[i] >= (T - cur - a[i]) / a[prev] + abs(i - prev)) {
            if (ex[i]) ans = max(ans, T / a[i]);
            cur = 0;
            prev = i;
        } else {
            cur += a[i];
            if (ex[i]) ans = max(ans, (T - cur) / a[prev] + abs(i - prev));
        }
    }
    cur = 0, prev = 0;
    for (int i = n; i >= 1; i--) {
        if (prev == 0 || T / a[i] >= (T - cur - a[i]) / a[prev] + abs(i - prev)) {
            if (ex[i]) ans = max(ans, T / a[i]);
            cur = 0;
            prev = i;
        } else {
            cur += a[i];
            if (ex[i]) ans = max(ans, (T - cur) / a[prev] + abs(i - prev));
        }
    }
    cout << ans;
    return 0;
}