#include <string>
#include <bitset>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>

using namespace std;
using ll = long long;
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()

// #define SUBMIT

#ifdef SUBMIT
    #pragma GCC optimize("Ofast,unroll-loops")
#endif

void fast() {
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    cout << setprecision(8) << fixed;
}

ll mod = 1e9 + 7;
ll binpow(ll a, ll n) {
    ll res = 1;
    for (int i = 0; (1ll << i) <= n; ++i, a = a * a % mod) {
        if ((n >> i) & 1) res = res * a % mod;
    }
    return res;
}

ll INF = 1e18;
void solve() {
    int n, m;
    cin >> n >> m;
    int T;
    cin >> T;
    vector<int> a(n);
    for (auto &el : a) cin >> el;
    vector<bool> marked(m);
    for (int i = 0; i < m; ++i) {
        int b;
        cin >> b;
        b--;
        marked[b] = true;
    }
    ll ans = 0;
    ll best = INF;
    int amount = 0;
    for (int i = 0; i < n; ++i) {
        if (best != INF && i > 0) {
            best += a[i - 1];
            amount++;
        }
        if (marked[i]) {
            best = 0;
            amount = 0;
        }
        if (best == INF) continue;
        ans = max(ans, max(0ll, (T - best)) / a[i] + amount);
    }
    best = INF;
    amount = 0;
    for (int i = n - 1; i >= 0; --i) {
        if (best != INF && i < n - 1) {
            best += a[i + 1];
            amount++;
        }
        if (marked[i]) {
            best = 0;
            amount = 0;
        }
        if (best == INF) continue;
        ans = max(ans, max(0ll, (T - best)) / a[i] + amount);
    }
    cout << ans;
} 

int main() {
    fast();
    int t = 1;
    // cin >> t;
    while (t--) solve();
    return 0;
}