#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

template<typename T>
bool assign_max(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}

template<typename T>
bool assign_min(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}

void solve() {
	ll n, m, T;
	cin >> n >> m >> T;
	vector<bool> be(n, false);
	vector<ll> arr(n);
	for (ll i = 0; i < n; i++) {
		cin >> arr[i];
	}
	for (ll i = 0; i < m; i++) {
		ll x;
		cin >> x;
		x--;
		be[x] = true;
	}
	ll ans = 0;
	for (ll i = 0; i < n; i++) {
		if (be[i]) {
			{
				ll nt = T;
				ll nc = 0;
				for (ll j = i; j >= 0; j--) {
					if (be[j] && j != i) {
						break;
					}
					nc++;
					nt -= arr[j];
					if (nt < 0) {
						break;
					}
					assign_max(ans, nc + nt / arr[j]);
				}
			}
			{
				ll nt = T;
				ll nc = 0;
				for (ll j = i; j < n; j++) {
					if (be[j] && j != i) {
						break;
					}
					nc++;
					nt -= arr[j];
					if (nt < 0) {
						break;
					}
					assign_max(ans, nc + nt / arr[j]);
				}
			}
		}
	}
	cout << ans << '\n';
}

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