#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main()
{
    cin.tie(nullptr);
    ios::sync_with_stdio(0);
    ll n,m,t;
    cin >> n >> m >> t;
    vector<ll> a(n);
    for (ll i = 0;i < n;i++) {
        cin >> a[i];
    }
    vector<ll> ans(n);
    vector<ll> opt(n);
    vector<ll> sum(n);
    for (ll i = 0;i < n;i++) {
        if (i==0) {
            ans[i] = t/a[i];
            opt[i] = i;
            sum[i] = 0;
            continue;
        }
        ll var1 = 0;
        if (sum[i-1]+a[i]<t) {
            var1 = (i-opt[i-1])+(t-sum[i-1]-a[i])/a[opt[i-1]];
        }
        else {
            opt[i] = i;
            ans[i] = t/a[i];
            sum[i] = 0;
            continue;
        }
        if (t/a[i]>var1) {
            ans[i] = t/a[i];
            opt[i] = i;
            sum[i] = 0;
            continue;
        }
        opt[i] = opt[i-1];
        ans[i] = var1;
        sum[i] = sum[i-1]+a[i];
    }
    opt.assign(n,0);
    sum.assign(n,0);
    /*for (ll i = n-1;i >= 0;i--) {
        if (i==n-1) {
            ans[i] = max(ans[i],t/a[i]);
            opt[i] = i;
            sum[i] = 0;
            continue;
        }
        ll var1 = 0;
        if (sum[i+1]+a[i]<t) {
            var1 = (opt[i+1]-i)+(t-sum[i+1]-a[i])/a[opt[i+1]];
        }
        else {
            opt[i] = i;
            ans[i] = max(ans[i],t/a[i]);
            sum[i] = 0;
            continue;
        }
        if (t/a[i]>var1) {
            ans[i] = max(ans[i],t/a[i]);
            opt[i] = i;
            sum[i] = 0;
            continue;
        }
        opt[i] = opt[i+1];
        ans[i] = max(ans[i],var1);
        sum[i] = sum[i+1]+a[i];
    }*/
    ll ma = 0;
    for (int i = 0;i < m;i++) {
        int x;
        cin >> x;
        ma = max(ma,ans[x-1]);
    }
    cout << ma << '\n';
    return 0;
}
