#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);
		v1 = (t - (prefs[i + 1] - prefs[ids[0] + 1])) / a[ids[0]] + i - ids[0];
		if (ids.size() > 1) {
			v2 = (t - (prefs[i + 1] - prefs[ids[1] + 1])) / a[ids[1]] + i - ids[1];
		}
		while (ids.size() > 1 && v1 <= v2) {
			ids.pop_front();
			v1 = (t - (prefs[i + 1] - prefs[ids[0] + 1])) / a[ids[0]] + i - ids[0];
			if (ids.size() > 1) {
				v2 = (t - (prefs[i + 1] - prefs[ids[1] + 1])) / a[ids[1]] + i - ids[1];
			}
		}
		anses[i] = (t - (prefs[i + 1] - prefs[ids[0] + 1])) / a[ids[0]] + i - ids[0];
	}
	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;
	}
	vector<int> x = getmins(a, n, t);
	reverse(a.begin(), a.end());
	vector<int> y = getmins(a, n, t);
	reverse(y.begin(), y.end());
	x[0] = -1e9;
	y[n - 1] = -1e9;
	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();
}
