//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("02")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define int long long
/*int gcd(int a, int b, int &x, int &y){
    //cout << a << " " << b << "\n";
    if (a == 0){
        x = 0y = 1;
        return b;
    }
    int x1, y1;
    int d = gcd(b % a, a, x1, y1);
    x = y1 - b / a * x1;
    y = x1;
    return d;
}*/
const int inf = 1e18 + 7;
const int N = 3e5 + 3, lg = 20;
signed main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n, m, T;
    cin >> n >> m >> T;
    vector<int> a(n);
    for (int i = 0; i < n; i++){
        cin >> a[i];
    }

    vector<int> pref(n + 1);
    for (int i = 1; i <= n; i++){
        pref[i] = pref[i - 1] + a[i - 1];
    }
    vector<int> b(m);
    for (int i = 0; i < m; i++){
        cin >> b[i];
        b[i]--;
    }
    int l = 0, r = 1e9 + 7;
    while (r - l > 1){
        int t = (r + l) / 2;
        bool f = false;
        for (int i = 0; i < n; i++){
            auto it = upper_bound(b.begin(), b.end(), i);
            auto ws = it;
            if (it != b.begin()){
                int j = *(--it);
                if (pref[i + 1] - pref[j] < T){
                    int c = (i - j + 1) + (T - (pref[i + 1] - pref[j])) / a[i];
                    if (c >= t){
                        f = true;
                    }
                }
            }
            it = ws;
            if (it != b.end()){
                int j = *it;
                if (pref[j + 1] - pref[i] < T){
                    int c = (j - i + 1) + (T - (pref[j + 1] - pref[j])) / a[i];
                    if (c >= t){
                        f = true;
                    }
                }
            }
        }

        if (f){
            l = t;
        } else {
            r = t;
        }
    }

    cout << l;
}
