#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<random>
#include<chrono>
#include<set>
#include<deque>
#include<array>
#define int long long
#define all(v) v.begin(), v.end()
#define ll long long
#define ld long double
using namespace std;
mt19937 rnd(chrono::steady_clock().now().time_since_epoch().count());

void solve() {
	int n, m, T;
	cin >> n >> m >> T;
	vector<int> v(n);
	for (int i = 0; i < n; i++) {
		cin >> v[i];
	}
	vector<bool> p(n);
	for (int i = 0; i < m; i++) {
		int j;
		cin >> j;
		j--;
		p[j] = 1;
	}

	vector<int> L(n), R(n);
	int last = -1;
	for (int i = 0; i < n; i++) {
		L[i] = last + 1;
		if (p[i])last = i;
	}
	last = n;
	for (int i = n - 1; i >= 0; i--) {
		R[i] = last - 1;
		if (p[i])last = i;
	}
	vector<int> pref(n + 1);
	for (int i = 0; i < n; i++) {
		pref[i + 1] = pref[i] + v[i];
	}
	int ans = 0;
	for (int i = 0; i < n; i++) {
		//cout << L[i] << " " << R[i] << endl;
		if (p[i]) {
			for (int j = L[i]; j <= i; j++) {
				if (T - (pref[i + 1] - pref[j + 1]) > 0) {
					ans = max(ans, (T - (pref[i + 1] - pref[j + 1])) / v[j] + i - j);
				}
			}
			for (int j = i + 1; j <= R[i]; j++) {
				if (T - (pref[j] - pref[i]) > 0) {
					ans = max(ans, (T - (pref[j] - pref[i])) / v[j] + j - i);
				}
			}
		}
	}
	cout << ans;
}

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