#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define int long long
#define db long double
#define MX LLONG_MAX
#define MN LLONG_MIN
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) (a / gcd(a, b) * b)

using namespace std;
using namespace __gnu_pbds;

typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;

int get_index(int x, ordered_set& st) {
    int res = st.order_of_key(x);
    if (res > st.size()) return -1;
    if (res == 0) {
        int ind = st.order_of_key(x + 1);
        if (ind == 1) {
            return 0;
        } else {
            return -1;
        }
    }
    return res;
}

int solve(int idx, int x, const int n, const int m, const int t, const vector<int>& a, const vector<int>& pref, const vector<int>& b, ordered_set& st) {
    int res = 0;
    //cout << "! " << idx + 1 << ":::\n";
    auto it = st.lower_bound(idx);
    if (it != st.end()) {
        int ind = get_index(*it, st);
        /*
        if (ind != -1) {
            cout << "r " << ind + 1 << ":\n";
            cout << "(" << t << " - " << "(" << pref[b[ind] + 1] << " - " << pref[idx + 1] << ")) / " << x << " + " << "(" << b[ind] << " - " << idx << ")\n";
        }
        */
        if (ind != -1) res = (t - (pref[b[ind] + 1] - pref[idx + 1])) / x + (b[ind] - idx);
    }
    if (it != st.begin()) {
        int ind = get_index(*--it, st);
        /*
        if (ind != -1) {
            cout << "l " << ind + 1 << "\n";
            cout << "(" << t << " - (" << pref[idx + 1] << " - " << pref[b[ind] + 1] << ")) / " << x << " + (" << idx << " - " << b[ind] << ")\n";
        }
        */
        if (ind != -1) res = max(res, (t - (pref[idx] - pref[b[ind]])) / x + (idx - b[ind]));
    }
    return res;
}

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

    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 + 1);
    pref[0] = 0;

    for (int i = 1; i <= n; i++) {
        pref[i] = pref[i - 1] + a[i - 1];
    }

    ordered_set st;
    vector<int> b(m);
    for (int i = 0; i < m; i++) {
        cin >> b[i];
        b[i]--;

        st.insert(b[i]);
    }

    int ans = 0;
    for (int i = 0; i < n; i++) {
        auto it = st.lower_bound(i);
        //if (it != st.end() && *it == i) cout << "!!!!! " << i << " " << t / a[i] << "\n";
        if (it != st.end() && *it == i) ans = max(ans, t / a[i]);
        else ans = max(ans, solve(i, a[i], n, m, t, a, pref, b, st));
    }

    cout << ans;
}
