#include <bits/stdc++.h>

using namespace std;
using ll = long long;
#define int ll

void solve() {
    int n, m, t;
    cin >> n >> m >> t;
    vector<int> a(n + 1);
    vector<int> pref(n + 1);
    vector<int> used(n + 1);
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        pref[i] = pref[i - 1] + a[i];
    }
    for (int i = 0, x; i < m; i++) {
        cin >> x;
        used[x] = 1;
    }
    int ans = 0;
    int j = 1;
    for (int i = 1; i <= n; i++) {
        if (pref[i] - pref[j - 1] > t)
            j = i;
        int r1 = i - j + (t - (pref[i] - pref[j])) / a[j];
        int r2 = t / a[i];
        if (r2 > r1)
            j = i;
        if (used[i])
            ans = max(ans, max(r1, r2));
    }

    j = n;
    for (int i = n; i >= 1; i--) {
        if (pref[j] - pref[i - 1] > t)
            j = i;
        int r1 = j - i + (t - (pref[j - 1] - pref[i - 1])) / a[j];
        int r2 = t / a[i];
        if (r2 > r1)
            j = i;
        if (used[i])
            ans = max(ans, max(r1, r2));
    }

    cout << ans;
}

signed main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    while (t--)
        solve();
}