//#define _GLIBCXX_DEBUG
//#define _GLIBCXX_DEBUG_PEDANTIC

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define OPTIMIZETHISSHIT ios::sync_with_stdio(false); cin.tie(nullptr);
#define int long long
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define fi first
#define se second

using namespace std;
using namespace __gnu_pbds;

template<typename T>
using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

mt19937_64 rng(0);

int rand(int l, int r) {
    return uniform_int_distribution<int>(l, r)(rng);
}

vector<int> a;
vector<int> pref;

int len(int start, int end) {
    if (end >= start) {
        return pref[end - 1] - pref[start - 1];
    } else {
        return pref[start] - pref[end];
    }
}

int t;

int get_cnt(int start, int end, int x) {
//    cout << start << ' ' << end << ' ' << len(start, end);
    if (len(start, end) <= t) {
//        cout << ' ' << abs(end - start) + (t - len(start, end)) / x << endl;
        return abs(end - start) + (t - len(start, end)) / x;
    } else {
//        cout << ' ' << -1 << endl;
        return -1;
    }
}

void solve() {
    int n, m;
    cin >> n >> m >> t;
    a.resize(n + 2);
    pref.resize(n + 1);
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= n; i++) {
        pref[i] = pref[i - 1] + a[i];
    }


    vector<int> prefdp(n + 1);
    prefdp[1] = 1;
    for (int i = 2, j = 1; i <= n; i++) {
        int v1 = get_cnt(i, j, a[j]);
        int v2 = get_cnt(i, j + 1, a[j + 1]);
        while (j + 1 <= i && (v2 > v1 || v1 == -1)) {
            j++;
            v1 = get_cnt(i, j, a[j]);
            v2 = get_cnt(i, j + 1, a[j + 1]);
        }
        prefdp[i] = j;
    }
    vector<int> suffdp(n + 2);
    reverse(all(a));
    for (int i = 1; i <= n; i++) {
        pref[i] = pref[i - 1] + a[i];
    }
    suffdp[1] = 1;
    for (int i = 2, j = 1; i <= n; i++) {
        while (j + 1 <= i && get_cnt(i, j + 1, a[j + 1]) >= get_cnt(i, j, a[j])) {
            j++;
        }
        suffdp[i] = j;
    }
    reverse(all(a));
    for (int i = 1; i <= n; i++) {
        pref[i] = pref[i - 1] + a[i];
    }
    reverse(all(suffdp));
    for (int i = 1; i <= n; i++) {
        suffdp[i] = n - suffdp[i] + 1;
    }
    vector<int> ans(n + 1);
    for (int i = 1; i <= n; i++) {
        int v1 = get_cnt(i, prefdp[i], a[prefdp[i]]);
        int v2 = get_cnt(i, suffdp[i], a[suffdp[i]]);
        if (v1 >= v2) {
            ans[i] = v1;
        } else {
            ans[i] = v2;
        }
    }
    int max_ans = 0;
    for (int i = 0; i < m; i++) {
        int c;
        cin >> c;
        max_ans = max(max_ans, ans[c]);

    }
    cout << max_ans << endl;
}

signed main() {
    OPTIMIZETHISSHIT

    solve();
}