#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <cmath>
#include <algorithm>

using namespace std;

typedef long long ll;

int main() {
    ios_base::sync_with_stdio(false), cin.tie(nullptr);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int n, m, t;
    cin >> n >> m >> t;
    vector<int> a(n);
    for (int &i : a) {
        cin >> i;
    }
    vector<int> st(n);
    for (int i = 0; i < m; ++i) {
        int x;
        cin >> x;
        x--;
        st[x] = 1;
    }
    ll ans = 0;
    ll carry = 0, cnt = 0;
    for (int i = 0; i < n; ++i) {
        if (st[i]) {
            carry = 0;
            cnt = 0;
        }
        if (carry != -1 && carry < t) {
            ans = max(ans, cnt + (t - carry) / a[i]);
        } else {
            carry = -1;
        }
        //cout << cnt << ' ' << carry << ' ' << cnt + (t - carry) / a[i] << '\n';
        if (carry != -1) {
            cnt++;
            carry += a[i];
        }
    }
    carry = -1, cnt = 0;
    for (int i = n - 1; i >= 0; --i) {
        if (st[i]) {
            carry = 0;
            cnt = 0;
        }
        if (carry != -1 && carry < t) {
            ans = max(ans, cnt + (t - carry) / a[i]);
        } else {
            carry = -1;
        }
        if (carry != -1) {
            cnt++;
            carry += a[i];
        }
    }
    cout << ans << '\n';
    return 0;
}
