#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "inline")
#include <ext/pb_ds/assoc_container.hpp>

#define pii pair <int, int>
#define fi first
#define se second
#define pb push_back
#define int int64_t

using namespace std;
using namespace __gnu_pbds;

typedef tree <int, null_type, less_equal <int>, rb_tree_tag, tree_order_statistics_node_update> oset;

mt19937 gen(time(0));

int32_t main () {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif // LOCAL
    int n, m, t;
    cin >> n >> m >> t;
    vector <int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    vector <int> pref(n);
    pref[0] = a[0];
    for (int i = 1; i < n; ++i) {
        pref[i] = pref[i - 1] + a[i];
    }
    auto sum = [&] (int l, int r) {
        if (!l) return pref[r];
        return pref[r] - pref[l - 1];
    };
    auto f = [&] (int i, int j) -> int {
        int s = sum(min(i, j), max(i, j));
        if (s > t) return 0;
        int k = abs(i - j) + 1;
        return k + (t - s) / a[j];
    };
    set <int> st;
    for (int i = 0; i < m; ++i) {
        int x;
        cin >> x;
        x--;
        st.insert(x);
    }
    int ans = 0;
    for (int i = 0; i < n; ++i) {
        auto it = st.lower_bound(i);
        if (it != st.end()) {
            ans = max(ans, f(*it, i));
        }
        if (it != st.begin()) {
            it--;
            ans = max(ans, f(*it, i));
        }
    }
    cout << ans;
}
