
#include <iostream>
#include <limits>
#include <chrono>
#include <random>
#include <iomanip>
#include <algorithm>
#include <chrono>
#include <random>
#include <math.h>
#include <set>
using namespace std;
#define int long long
signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n, m, t;
	cin >> n >> m >> t;
	vector <int> vec(n);
	for (int i = 0;i < n;i++)cin >> vec[i];
	int best = 0;
	for (int i = 0;i < n;i++) {
		best = max(best, t / vec[i]);
	}
	if (n == m) {
		cout << best;
		exit(0);
	}
	vector <bool> fl(n, false);
	for (int i = 0;i < m;i++) {
		int num;
		cin >> num;
		num--;
		fl[num] = 1;
	}
	// (!fl[j] || j == i)
	int ans = 0;
	for (int i = 0;i < n;i++) {
		if (!fl[i])continue;
		int buy = 0;
		for (int j = i;j >= 0 ;j--) {
			int a = i - j + (t - buy) / vec[j];
			ans = max(ans,a);
			buy += vec[j];
			if (buy > t)break;
		}
		buy = 0;
		for (int j = i;j < n;j++) {
			int a = j - i + (t - buy) / vec[j];
			ans = max(ans, a);
			buy += vec[j];
			if (buy > t)break;
		}
	}
	cout << ans;
}