/*#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx2")
#pragma GCC optimize("Ofast")*/

#include <iostream>
#include <math.h>
#include <iostream>
#include <string>
#include <fstream>
#include <set>
#include <vector>
#include <algorithm>
#include <random>

using namespace std;
using ll = long long;
using ld = long double;
const ll MAXN = 5e3 + 5;
const ll MOD = 1e9 + 7;
const ll INF = 1e18 + 8;


int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll a;
    ll n,m,T;
    cin >> n >> m >> T;
    vector<ll> arr;
    vector<bool> used(n,false);
    for (int i = 0;i<n;i++){
        cin >> a;
        arr.push_back(a);
    }
    for (int i = 0;i<m;i++){
        cin >> a;
        used[a-1] = true;
    }
    ll res = 0;
    ll ind = 0;
    ll pref = -1;
    for (int i = 0;i<n;i++){
        if (used[i]){
            res = max(res,T/arr[i]);
            ind = i;
            pref = 0;
        }
        if (pref != -1){
            res = max(res,i - ind + (T-pref)/arr[i]);
            pref += arr[i];
        }
    }
    pref = -1;
    for (int i = n-1;i>-1;i--){
        if (used[i]){
            res = max(res,T/arr[i]);
            ind = i;
            pref = 0;
        }
        if (pref != -1){
            res = max(res,ind - i + (T-pref)/arr[i]);
            pref += arr[i];
        }
    }
    cout << res << "\n";
}
