#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

#define int long long
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()

using ll = long long;
using pii = pair<int, int>;
using ld = long double;

const int INF = 1e18;
const int MOD = 1e9 + 7;

int divup(int a, int b) {
    if (a % b == 0) return a / b;
    return a / b + 1;
}

void wr(vector<int> a) {
    for (int i : a) cout << i << ' ';
    cout << '\n';
}
void wr(vector<pii> a) {
    for (pii i : a) cout << "{" << i.first << ", " << i.second << "} ";
    cout << '\n';
}


struct fenv {
    int n;
    vector<int> v;
    fenv (int n): n(n) {
        v.resize(n + 1, 0);
    }
    void add(int ind, int x) {
        for (int i = ind + 1; i <= n; i += i&-i) v[i] += x;
    }
    int pref(int r) {
        int res = 0;
        for (int i = r; i > 0; i -= i&-i) res += v[i];
        return res;
    }
};




void solve() {
    int n, m, t; cin >> n >> m >> t;
    vector<int> a(n), b(m + 2);
    for (int &i : a) cin >> i;
    b[0] = -1;
    b[m + 1] = n;
    for (int i = 1; i <= m; i++) {
        cin >> b[i]; b[i]--;
    }
    sort(all(b));
    bool sor = 1;
    for (int i = 1; i < n; i++) {
        if (a[i - 1] > a[i]) sor = 0;
    }
    if (sor) {
        int ans = 0;
        for (int i = b[1]; i > -1; i--) {
            if (t < a[i]) break;
            ans++;
            t -= a[i];
            if (i == 0) {
                ans += t / a[i];
            }
        }
        cout << ans;
        return;
    }

    for (int i = 1; i <= m; i++) {
        int ost = t, res = 0;
        for (int j = b[i]; j > b[i - 1]; j--) {
            ans = max(ans, res + (ost / a[j]));
            if (ost < a[j]) continue;
            res++;
            ost -= a[j];
        }
        ost = t, res = 0;
        for (int j = b[i]; j < b[i + 1]; j++) {
            ans = max(ans, res + (ost / a[j]));
            if (ost < a[j]) continue;
            res++;
            ost -= a[j];
        }
    }
    cout << ans;
}


signed main() {
    //ios_base::sync_with_stdio(0);
    //cin.tie(0);
    int tt = 1; //cin >> tt;
    while (tt--) {
        solve();
    }
}