#pragma GCC optimize("O3")
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <deque>
#include <random>
#include <string>

using namespace std;
#define int long long
using ll = long long;
using ld = long double;

#define dbg(x) cerr << #x << ": " << x << '\n'

signed main() {
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

	int n, m, t;
	cin >> n >> m >> t;
	vector<int> a(n);
	for (int i = 0; i < n; i++) cin >> a[i];
	int ans = 0;
	for (int iter = 0; iter < m; iter++) {
		int b;
		cin >> b;
		b--;
		int cur = 0, sum = 0, curmi = a[b];
		for (int i = b; i < n; i++) {
			curmi = min(curmi, a[i]);
			cur = max(cur, abs(i - b) + (t - sum) / curmi);
			sum += a[i];
			if (sum > t) break;
		}
		ans = max(ans, cur);
		cur = 0; sum = 0; curmi = a[b];
		for (int i = b; i >= 0; i--) {
			curmi = min(curmi, a[i]);
			cur = max(cur, abs(i - b) + (t - sum) / curmi);
			sum += a[i];
			if (sum > t) break;
		}
		ans = max(ans, cur);
	}
	cout << ans << '\n';
}

