//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#pragma GCC optimize("O3,Ofast,fast-math,unroll-loops")
#pragma GCC target("avx,avx2,fma,sse,sse2,sse3,sse4,sse4.1,sse4.2")
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
template<class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define int long long


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

    int n, m, T;
    cin >> n >> m >> T;
    vector<int> b(n, 0);
    vector<int>a(n);
    int res = 0;
    vector<int>pref(n+1, 0);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        pref[i + 1] = pref[i] + a[i];
    }
    for (int i = 0; i < n; ++i) {
        int best_ans = 0;
        int j=i;
        while (j >= 0) {
            int curT = T;
            int cur_ans = 0;
            if (i>j) {
                curT-=pref[i+1]-pref[j];
            } else {
                curT -= pref[j]-pref[i];
            }
            if (curT >= 0) {
                cur_ans += abs(j-i);
                cur_ans += (curT/a[j]);
            } else {
                j=0;
            }
            best_ans=max(best_ans, cur_ans);
            j--;
        }
        j=i+1;
        while (j<n) {
            int curT = T;
            int cur_ans = 0;
            if (i>j) {
                curT-=pref[i+1]-pref[j];
            } else {
                curT -= pref[j]-pref[i];
            }
            if (curT >= 0) {
                cur_ans += abs(j-i);
                cur_ans += (curT/a[j]);
            } else {
                j=n;
            }
            //out<<i<<" "<<j<<" "<<cur_ans<<"\n";
            best_ans=max(best_ans, cur_ans);
            j++;
        }
        b[i]=best_ans;
    }
    for (int i = 0; i < m; ++i) {
        int x;
        cin >> x;
        res = max(res, b[x-1]);
    }
    cout<<res;
}
