#include <bits/stdc++.h>
#define int long long
using namespace std;

signed main() {
#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 = 0; i < n; i++) cin >> a[i];
    vector<int> tme(n);
    int answer = 0;
    vector<int> ans(n);
    for (int i = 0; i < n; i++) {
        int sum = 0; int k = 0;
        int mn = INT_MAX;
        for (int j = i; j < n; j++) {
            sum += a[j];
            k++; mn = min(mn, a[j]);
            if (sum <= t) {
                ans[i] = max(ans[i], k + (t - sum) / mn);
            }
        }
        k = 0; sum = 0; mn = INT_MAX;
        for (int j = i; j >= 0; j--) {
            sum += a[j];
            k++; mn = min(mn, a[j]);
            if (sum <= t) {
                ans[i] = max(ans[i], k + (t - sum) / mn);
            }
        }
    }
    int ey = 0;
    while (m--) {
        int o; cin >> o;
        ey = max(ey, ans[o - 1]);
    }
    cout << ey << '\n';
    return 0;
}
