#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

using ll = long long;

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	ll n, m, t; cin >> n >> m >> t;
	vector<ll> vec(n);
	for (int i = 0; i < n; i++) cin >> vec[i];
	vector<int> start(m);
	for (int i = 0; i < m; i++) {
		cin >> start[i];
		start[i]--;
	}
	vector<pair<int, int>> needToCheck;
	for (int i = 0; i < m; i++) {
		needToCheck.push_back({ i, start[i] });
	}
	ll last = -1;
	vector<int> runner(n, -1);
	for (int i = 0; i < m; i++) runner[start[i]] = i;
	for (int i = 0; i < n; i++) {
		if (last != -1) needToCheck.push_back({ last, i });
		if (runner[i] != -1) last = runner[i];
	}
	last = -1;
	for (int i = n - 1; i >= 0; i--) {
		if (last != -1) needToCheck.push_back({ last, i });
		if (runner[i] != -1) last = runner[i];
	}
	ll ans = 0;
	vector<ll> pref(1);
	for (auto p : vec) pref.push_back(pref.back() + p);
	for (auto p : needToCheck) {
		ll from = vec[start[p.first]];
		ll to = vec[p.second];
		ll dist = abs(start[p.first] - p.second);
		ll l = start[p.first];
		ll r = p.second;
		if (l > r) swap(l, r);
		ll distsum = pref[r + 1] - pref[l] - to;
		if (distsum > t) continue;
		ll lans = dist;
		lans += (t - distsum) / to;
		ans = max(ans, lans);
	}
	cout << ans << endl;
}