//#pragma GCC optimize("Ofast")

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

using namespace std;
using namespace __gnu_pbds;
using ll = long long;

template<class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

//.find_by_order(1); по индексу
//.order_of_key(1);

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

void solve();

int32_t main() {
#ifdef LOCAL
    freopen("Input.txt", "r", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);
    int t = 1;
//    cin >> t;
    while (t--) {
        solve();
    }
}

constexpr int MAXN = 3e5 + 1;
constexpr ll INF = 1e18;

struct Line {
    ll k = 0, b = INF;
    int l = -1, r = -1;

    ll get(ll x) {
        return k * x + b;
    }
};

#define int long long
Line d[10 * MAXN];
int cnt = 1;

void update(int v, int l, int r, Line a) {
    if (l > r) return;
    int m = (l + r) / 2;
    bool ql = a.get(l) < d[v].get(l);
    bool qm = a.get(m) < d[v].get(m);
    if (qm) {
        swap(a, d[v]);
    }
    if (ql) {
        if (d[v].l == -1)d[v].l = cnt++;
        update(d[v].l, l, m - 1, a);
    } else {
        if (d[v].r == -1)d[v].r = cnt++;
        update(d[v].r, m + 1, r, a);
    }
}


ll get(int v, int l, int r, ll x) {
    if (l > r) {
        return INF;
    }
    int m = (l + r) / 2;
    if (x == m) {
        return d[v].get(x);
    }
    if (x < m) {
        if (d[v].l == -1)d[v].l = cnt++;
        return min(d[v].get(x), get(d[v].l, l, m - 1, x));
    } else {
        if (d[v].r == -1)d[v].r = cnt++;
        return min(d[v].get(x), get(d[v].r, m + 1, r, x));
    }
}

int32_t a[MAXN], b[MAXN];

void solve() {
    int n, m, T;
    cin >> n >> m >> T;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    vector<ll> pref(n + 1);
    for (int i = 1; i < n + 1; ++i) {
        pref[i] = pref[i - 1] + a[i - 1];
    }
    for (int i = 0; i < m; ++i) {
        int g;
        cin >> g;
        b[g - 1] = 1;
    }
    ll ans = 0;
    if (b[0]) {
        update(0, 0, 1e10 + 1, Line(0, pref[0]));
    }
    for (int i = 1; i <= n; ++i) {
        ll f = get(0, 0, 1e10 + 1, a[i - 1]);
        ll k = T - pref[i] + a[i - 1] * i;
        ans = max(ans, (k - f) / a[i - 1]);
        if (b[i]) {
            update(0, 0, 1e10 + 1, Line(i, -pref[i]));
        }
    }
    for (int i = 0; i < 10 * MAXN; ++i) {
        d[i] = Line(0, INF);
    }
    for (int i = n - 1; i >= 0; --i) {
        ll k = T - (pref[n] - pref[i + 1]) + a[i] * (n - 1 - i);
        ll f = get(0, 0, 1e10 + 1, a[i]);
        ans = max(ans, (k - f) / a[i]);
        if (b[i+1]) {
            update(0, 0, 1e10 + 1, Line(n - 1 - i, -(pref[n] - pref[i + 1])));
        }
    }
    cout << ans << '\n';
}