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


using namespace __gnu_pbds;
using namespace std;

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

//#pragma GCC optimize("O3")
//#pragma GCC target("avx,avx2,bmi2,fma,popcnt")

#define int long long
#define x first
#define y second

int inf = 1'000'000'000'000'000'000;

mt19937 mt(42);

/*
int merge(int a, int b) {
    return max(a, b);
}

struct SegTree {
    vector<int> v;
    vector<int> push;


    void build2(int ind, int l, int r, vector<int>& ve) {
        if (l + 1 == r) {
            v[ind] = ve[l];
            return;
        }
        int mid = (l + r) / 2;
        build2(2 * ind + 1, l, mid, ve);
        build2(2 * ind + 2, mid, r, ve);
        v[ind] = merge(v[2 * ind + 1], v[2 * ind + 2]);
    }

    void build(vector<int>& ve) {
        int n = ve.size();

        v.resize(4 * n);
        push.resize(4 * n, 0);
        build2(0, 0, n, ve);
    }

    void pushh(int ind, int l, int r) {
        if (l + 1 != r) {
            push[2 * ind + 1] += push[ind];
            push[2 * ind + 2] += push[ind];
        }
        v[ind] += push[ind];
        push[ind] = 0;
    }

    void update(int ind, int l, int r, int ql, int qr, int k) {
        pushh(ind, l, r);
        if (ql <= l && r <= qr) {
            push[ind] += k;
            pushh(ind, l, r);
            return;
        }
        if (qr <= l || r <= ql) {
            return;
        }
        int mid = (l + r) / 2;
        update(2 * ind + 1, l, mid, ql, qr, k);
        update(2 * ind + 2, mid, r, ql, qr, k);
        v[ind] = merge(v[2 * ind + 1], v[2 * ind + 2]);
    }

    int getmax(int ind, int l, int r, int ql, int qr) {
        if (ql <= l && r <= qr) {
            return v[ind];
        }
        if (qr <= l || r <= ql) {
            return -inf;
        }
        int mid = (l + r) / 2;
        return merge(getmax(2 * ind + 1, l, mid, ql, qr),
                     getmax(2 * ind + 2, mid, r, ql, qr));
    }
};

int n;
vector<int> sz;
vector<int> head, predd;
vector<int> tin, tout;
vector<vector<int>> g;

void sizes(int ind, int pred = -1) {
    sz[ind] = 1;
    if (pred != -1) {
        predd[ind] = pred;
    }
    for (auto& i : g[ind]) {
        if (i != pred) {
            sizes(i, ind);
            sz[ind] += sz[i];
            if (sz[i] > sz[g[ind][0]] || g[ind][0] == pred) {
                swap(i, g[ind][0]);
            }
        }
    }
}

int ttt = 0;
void tinout(int ind, int pred = -1) {
    tin[ind] = ttt++;
    for (auto& i : g[ind]) {
        if (i != pred) {
            head[i] = (i == g[ind][0]) ? head[ind] : i;
            tinout(i, ind);
        }
    }
    tout[ind] = ttt;
}

SegTree t;

bool ancestor(int a, int b) {
    return tin[a] <= tin[b] && tin[b] < tout[a];
}

void up(int& a, int& b, int& ans) {
    while (!ancestor(head[a], b)) {
        ans = merge(ans, t.getmax(0, 0, n, tin[head[a]], tin[a] + 1));
        a = predd[head[a]];
    }
}

int lca(int a, int b) {
    int ans = -inf;
    up(a, b, ans);
    up(b, a, ans);

    if (!ancestor(a, b)) {
        swap(a, b);
    }
    return a;
}

int getmax(int a, int b) {
    int ans = -inf;
    up(a, b, ans);
    up(b, a, ans);

    if (!ancestor(a, b)) {
        swap(a, b);
    }
    ans = merge(ans, t.getmax(0, 0, n, tin[a], tin[b] + 1));
    return ans;
}

void definehld() {
    cin >> n;
    g.resize(n);
    head.resize(n);
    predd.resize(n);
    tin.resize(n);
    tout.resize(n);
    sz.resize(n);
    head[0] = 0;
    predd[0] = 0;
    for (int i = 1; i <= n; i++) {
        int a, b;
        cin >> a >> b; a--; b--;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    sizes(0);
    tinout(0);

    //t.build();
}*/

void solve() {
    int n, m, T, a;
    cin >> n >> m >> T;
    vector<int> v(n);
    for (auto& i : v) {
        cin >> i;
    }
    vector<int> is(n);
    for (int i = 0; i < m; i++) {
        cin >> a; a--;
        is[a] = 1;
    }
    int ans = 0, cur = inf, sum = -inf;
    for (int i = 0; i < n; i++) {
            if (T - cur >= 0) {
                ans = max(ans, (T - cur) / v[i] + sum);
            }
            cur = cur + v[i];
            sum++;
            if (is[i]) {
                ans = max(ans, (T) / v[i]);
                cur = v[i];
                sum = 1;
            }
            //cout << i << ' ' << ans << ' ' << cur << '\n';
    }
    cur = inf; sum = -inf;
    for (int i = n - 1; i >= 0; i--) {
        if (T - cur >= 0) {
            ans = max(ans, (T - cur) / v[i] + sum);
        }
        cur = cur + v[i];
        sum++;
        if (is[i]) {
            ans = max(ans, (T) / v[i]);
            cur = v[i];
            sum = 1;
        }
        //cout << i << ' ' << ans << ' ' << cur << '\n';
    }
    cout << ans;
}

signed main() {
#ifdef lisie_bimbi
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    //cin.tie(nullptr);
    //ios_base::sync_with_stdio(false);
#endif
    int _ = 1;
    //cin >> _;
    while (_--) {
        solve();
    }
}