#include <iostream>
#include <vector>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <queue>
#include <deque>
#include <set>
#include <map>
#define int long long
#define ld long double

using namespace std;

vector<int> getmins(vector<int> a, int n, int t) {
	vector<int> prefs(n + 1);
	for (int i = 0; i < n; i++) {
		prefs[i + 1] = prefs[i] + a[i];
	}
	deque<int> ids = { 0 };
	vector<int> anses(n);
	int v1, v2;
	for (int i = 1; i < n; i++) {
		while (!ids.empty() && a[i] <= a[ids[ids.size() - 1]]) ids.pop_back();
		ids.push_back(i);
		int l = 0;
		int r = ids.size();
		while (l + 2 < r) {
			int m1 = l + (r - l) / 3;
			int m2 = m1 + (r - l) / 3;
			int val1 = (t - (prefs[i + 1] - prefs[ids[m1] + 1])) / a[ids[m1]] + i - ids[m1];
			int val2 = (t - (prefs[i + 1] - prefs[ids[m2] + 1])) / a[ids[m2]] + i - ids[m2];
			if (val1 < val2) {
				l = m1;
			}
			else {
				r = m2;
			}
		}
		anses[i] = (t - (prefs[i + 1] - prefs[ids[l] + 1])) / a[ids[l]] + i - ids[l];
		if (r != ids.size()) {
			anses[i] = max(anses[i], (t - (prefs[i + 1] - prefs[ids[r] + 1])) / a[ids[r]] + i - ids[r]);
		}
		if (l + 1 < ids.size()) {
			anses[i] = max(anses[i], (t - (prefs[i + 1] - prefs[ids[l + 1] + 1])) / a[ids[l + 1]] + i - ids[l + 1]);
		}
	}
	return anses;
}

void solve() {
	int n, m, t, ind;
	cin >> n >> m >> t;
	vector<int> a(n);
	for (int i = 0; i < n; i++) cin >> a[i];
	vector<bool> b(n);
	for (int i = 0; i < m; i++) {
		cin >> ind;
		ind--;
		b[ind] = true;
	}
	if (n == 1) {
		cout << t / a[0] << '\n';
		return;
	}
	vector<int> x = getmins(a, n, t);
	reverse(a.begin(), a.end());
	vector<int> y = getmins(a, n, t);
	reverse(y.begin(), y.end());
	int ans = 0;
	for (int i = 0; i < n; i++) {
		if (b[i]) {
			ans = max(ans, max(x[i], y[i]));
		}
	}
	cout << ans << '\n';
}

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