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

#define f first
#define s second
#define pb push_back
#define pf push_front
#define in insert
#define oo 1e18
#define nl '\n'
#define orderedSet tree <int, null_type, less <int>, rb_tree_tag, tree_order_statistics_node_update>

#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC poison

typedef long double ld;
typedef int64_t int64;
typedef uint64_t uint64;
typedef uint32_t uint;

using namespace std;
using namespace __gnu_pbds;
mt19937_64 rnd(chrono::steady_clock::now().time_since_epoch().count());

#define int int64

const int N = 3e5 + 9;

bool bb[N];
int n, m, t, a[N], b[N], pr[N];

main() {
    cin.tie(0); ios::sync_with_stdio(0); cout.tie(0);
    int n, m, t;
    cin >> n >> m >> t;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        pr[i] = (i > 0 ? pr[i - 1] : 0) + a[i];
    }
    set <int> st;
    for (int i = 0; i < m; ++i) {
        int x;
        cin >> x;
             --x;
        st.in(x);
    }
    int ans = 0;
    for (int i = 0; i < n; ++i) {
        auto it = st.upper_bound(i),
             it2 = it;
        if (it2 == st.begin())
            it2 = st.end();
        else
            --it2;
        if (it != st.end() && pr[*it] - pr[i] <= t)
            ans = max(ans, ((*it) - i) + (t - (pr[*it] - pr[i])) / a[i]);
        if (it2 != st.end() && pr[i - 1] - ((*it2) > 0 ? pr[(*it2) - 1] : 0) <= t)
            ans = max(ans, (i - (*it2)) + (t - (pr[i - 1] - ((*it2) > 0 ? pr[(*it2) - 1] : 0))) / a[i]);
    }
    cout << ans;
}
