#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <set>
#include <map>
#include <array>
using namespace std;
typedef long long ll;
const ll Inf = 1e16;
/*struct SegmentTree {
    struct Node {
        ll sm;
        Node(ll a = 0) { sm = a; }
    };
    vector<Node>tree; ll n;
    SegmentTree(vector<ll>& a) {
        n = a.size(); tree.resize(4 * n);
        build(0, 0, n, a);
    }
    void build(ll v, ll l, ll r, vector<ll>&a) {
        if (r - l == 1) {
            tree[v] = Node(a[l]); return;
        }
        ll mid = (l + r)/2;
        build(2 * v + 1, l, mid, a);
        build(2 * v + 2, mid, r, a);
        tree[v] = merge(tree[2 * v + 1], tree[2 * v + 2]);
    }
    Node merge(Node&a, Node&b) {
        return Node(a.sm + b.sm);
    }
    Node get(ll v, ll l, ll r, ll ind) {
        if (r - l == 1)return tree[v];
        ll mid = (l + r) / 2;
        if (ind < mid)return get(2*v + 1, l, mid, ind);
        return get(2 * v + 2, mid, r, ind);
    }
};*/
int main()
{
    cin.tie(0)->sync_with_stdio(0);
    ll n, m, t; cin >> n >> m >> t;
    vector<ll>a(n); vector<ll>pref(n + 1);
    for (int i = 0; i < n; i++) {
        cin >> a[i]; pref[i + 1] = pref[i] + a[i];
    }
    vector<ll>ans(n, 0);
    for (int i = 0; i < n; i++) {
        ll l = -1, r = n;
        while (r - l > 2) {
            ll mid1 = l + (r - l) / 3;
            ll mid2 = r - (r - l) / 3;

            ll sm1 = pref[i + 1] - pref[mid1];
            if (i < mid1)sm1 = pref[mid1 + 1] - pref[i];
            ll res1 = (t - sm1) / a[mid1] + abs(i - mid1) + 1;
            if (t - sm1 < 0)res1 = -abs(mid1-i);

            ll sm2 = pref[i + 1] - pref[mid2];
            if (i < mid2)sm2 = pref[mid2 + 1] - pref[i];
            ll res2 = (t - sm2) / a[mid2] + abs(i - mid2) + 1;
            if (t - sm2 < 0)res2 = -abs(mid2 - i);

            if (res1 >= res2)r = mid2;
            else l = mid1;
        }
        r--;

        ll sm = pref[i + 1] - pref[r];
        if (i < r)sm = pref[r + 1] - pref[i];
        ll res = (t - sm) / a[r] + abs(i - r) + 1;
        if (t - sm < 0)res = 0;
        ans[i] = res;
    }
    ll mx = 0;
    while (m--) {
        ll q; cin >> q; q--;
        mx = max(mx, ans[q]);
    }
    cout << mx;
}