#include <bits/stdc++.h>

using namespace std;

using ll = long long;

const int inf = 1e9 + 10;

void solve() {
    ll n, m, t;
    cin >> n >> m >> t;
    vector<ll> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    vector<bool> pos(n);
    for (int i = 0; i < m; i++) {
        int x;
        cin >> x;
        x--;
        pos[x] = true;
    }
    ll ans = 0;
    ll ntm = inf;
    ll cnt = 0;
    for (int i = 0; i < n; i++) {
        if (pos[i]) {
            ntm = 0;
            cnt = 0;
        }
        ans = max(ans, max(t - ntm, 0ll) / a[i] + cnt);
        ntm += a[i];
        cnt++;
    }
    ntm = inf;
    cnt = 0;
    for (int i = n - 1; i >= 0; i--) {
        if (pos[i]) {
            ntm = 0;
            cnt = 0;
        }
        ans = max(ans, max(t - ntm, 0ll) / a[i] + cnt);
        ntm += a[i];
        cnt++;
    }
    cout << ans << '\n';
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int t = 1;
    for (int i = 0; i < t; i++) solve();
}
