#ifdef LOCAL
#pragma optimize("", off)
#include "localstd1.h"
#else
#pragma GCC optimize("Ofast,unroll-loops")
#include <bits/allocator.h>
#pragma GCC target("avx2,bmi,bmi2")
#include <bits/stdc++.h>
#endif

using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;

#define all(a) (a).begin(), (a).end()

ll solve(vector<ll> a, vector<bool> good, int n, ll T) {
	a.push_back(INT_MAX); good.push_back(false);
	int last = -1;
	ll sum = T, res = -1;
	for (int i = 0; i < n; i++) {
		if (good[i]) {
			sum = 0;
			last = i;
		}
		if (last != -1 && sum < T) {
			res = max(res, i - last + (T - sum) / a[i]);
		}
		sum += a[i];
	}
	return res;
}

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

	ll n, m, T; cin >> n >> m >> T;
	vector<ll> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	vector<bool> good(n);
	for (int i = 0; i < m; i++) {
		int x; cin >> x; x--;
		good[x] = true;
	}
	ll res = solve(a, good, n, T);
	reverse(all(a));
	reverse(all(good));
	res = max(res, solve(a, good, n, T));
	cout << res;
	
	return 0;
}