#ifdef _DEBUG
#include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <cassert>
#else
#include <bits/stdc++.h>
#endif

using namespace std;
#define int int64_t

void solve() {
	int n, m, t;
	cin >> n >> m >> t;
	vector<int> a(n), b(m);
	for (int& i : a) cin >> i;
	for (int& i : b) cin >> i;
	for (int& i : b) --i;
	sort(b.begin(), b.end());
	vector<int> pref_sum(n + 1, 0);
	for (int i = 1; i <= n; ++i) pref_sum[i] = pref_sum[i - 1] + a[i - 1];
	int ans = 0;
	for (int i = 0; i < n; ++i) {
		auto ind = lower_bound(b.begin(), b.end(), i);
		if (ind != b.begin()) {
			--ind;
			int cur = pref_sum[i] - pref_sum[*ind];
			ans = max(ans, max(0LL, (t - abs(cur)) / a[i]));
			++ind;
		}
		if (ind != b.end()) {
			ans = max(ans, max(0LL, (t - abs(pref_sum[i] - pref_sum[*ind]))) / a[i]);
		}
		if (ind != (--b.end()) && ind != b.end()) {
			++ind;
			ans = max(ans, max(0LL, (t - abs(pref_sum[i] - pref_sum[*ind]))) / a[i]);
		}
		ind = upper_bound(b.begin(), b.end(), i);
		if (ind != b.end()) {
			ans = max(ans, max(0LL, (t - abs(pref_sum[i] - pref_sum[*ind]))) / a[i]);
		}
	}
	cout << ans << endl;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);

	int test = 1;
	//cin >> test;

	while (test--) {
		solve();
	}

	return 0;
}