#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <random>
#include <deque>
#include <stack>
#include <cmath>
#include <iomanip>

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

//mt19937 rnd(288);

const int INF = 1e9 + 239;
const int EPS = 1e-9;

void fastw() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
}

vector<int> get(vector<int> a, int n, int t) {
	vector<int> pref(n + 1, 0);
	for (int i = 1; i <= n; i++) {
		pref[i] = pref[i - 1] + a[i];
	}
	deque<int> d;
	vector<int> ans(n + 1);
	for (int i = 1; i <= n; i++) {
		while (d.size() > 0 && a[d.back()] >= a[i]) {
			d.pop_back();
		}
		d.push_back(i);
		bool fl = true;
		while (d.size() > 1 && fl) {
			int now = d.front();
			d.pop_front();
			if (t - (pref[i] - pref[now]) >= 0 && i - now + (t - (pref[i] - pref[now])) / a[now] > i - d.front() + (t - (pref[i] - pref[d.front()])) / a[d.front()]) {
				d.push_front(now);
				fl = false;
			}
		}
		ans[i] = i - d.front() + (t - (pref[i] - pref[d.front()])) / a[d.front()];
		if (t - (pref[i] - pref[d.front()]) < 0) {
			ans[i] = 0;
		}
	}
	return ans;
}

void solve() {
	int n, m, t;
	cin >> n >> m >> t;
	vector<int> a(n + 1);
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
	}
	vector<int> ans1 = get(a, n, t);
	reverse(a.begin(), a.end());
	for (int i = n; i > 0; i--) {
		a[i] = a[i - 1];
	}
	a[0] = 0;
	vector<int> ans2 = get(a, n, t);
	reverse(ans2.begin(), ans2.end());
	for (int i = n; i > 0; i--) {
		ans2[i] = ans2[i - 1];
	}
	int ans = 0;
	while (m--) {
		int pos;
		cin >> pos;
		ans = max(ans, max(ans1[pos], ans2[pos]));
	}
	cout << ans;
}

signed main() {
	fastw();
	int tt = 1;
	//cin >> tt;
	while (tt--) {
		solve();
		cout << '\n';
	}
}