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

using namespace __gnu_pbds;
using namespace std;

template<class T>
using order_set = tree<T, nullptr_t, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

using ll = long long;
using ld = long double;
using mll = map<ll, ll>;
using pll = pair<ll, ll>;
using vll = vector<ll>;

const ll inf = 1e16;
const ll mod = 1e9 + 7;
const ld eps = 1e-9;

const ll nmax = 3e5 + 1;
ll p[nmax], mark[nmax];
ll a[nmax];
ll n, m, T;

ll f(ll i, ll j) {
    if (abs(i) == inf || abs(j) == inf)
        return inf;
    return p[max(i, j) + 1] - p[min(i, j)];
}

struct node {
    ll mx;
    ll last, first;
};

node solve(ll l, ll r) {
    if (r - l == 1) {
        if (mark[l])
            return {T / a[l], l, l};
        return {-inf, inf, -inf};
    }
    ll mid = (l + r) / 2;
    node lch = solve(l, mid);
    node rch = solve(mid, r);
    ll res = max(lch.mx, rch.mx);
    for (ll i = lch.first; i < r; i++) {
        if (T - f(lch.first, i) >= 0)
            res = max(res, (i - lch.first + 1) + (T - f(lch.first, i)) / a[i]);
        else
            break;
    }
    for (ll i = rch.last; i >= l; i--) {
        if (T - f(i, rch.last) >= 0)
            res = max(res, (rch.last - i + 1) + (T - f(i, rch.last)) / a[i]);
        else
            break;
    }
    return {res, lch.last, rch.first};
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    cin >> n >> m >> T;
    set<ll> bd;
    for (ll i = 0; i < n; i++)
        cin >> a[i];
    for (ll i = 0; i < m; i++) {
        ll t;
        cin >> t;
        bd.insert(t - 1);
        mark[t - 1] = 1;
    }

    vector<ll> b;
    for (ll i: bd)
        b.push_back(i);

    for (ll i = 0; i < n; i++)
        p[i + 1] = p[i] + a[i];

    node res = solve(0, n);
    ll i = 0, j = n - 1;
    while (i < j) {
        swap(a[i], a[j]);
        i++;
        j--;
    }
    ll ans = max(res.mx, solve(0, n).mx);
    cout << ans << '\n';
}