#include <bits/stdc++.h>

using namespace std;
#define int long long

struct line {
    long double k, b;
    int ind;

    line() : k(0), b(0), ind(0) {};

    line(long double _k, long double _b, int _ind) : k(_k), b(_b), ind(_ind) {};

    long double getX(long double x) {
        return k * x + b;
    }
};

long double interSect(line a, line b) {
    return (b.b - a.b) / (a.k - b.k);
}

deque<line> st;
int sz = 0;

void clear() {
    st.clear(), sz = 0;
}

void push_front(line k) {
    while (sz >= 2 && interSect(st[0], st[1]) <= interSect(st[0], k))
        st.pop_front(), sz--;
    st.push_front(k), sz++;
}

long double get(long double x) {
    int l = 0, r = sz;
    while (r - l > 1) {
        int mid = (l + r) / 2;
        if (interSect(st[mid - 1], st[mid]) <= x)
            l = mid;
        else
            r = mid;
    }
    return st[l].getX(x);
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n, m, T;
    cin >> n >> m >> T;
    int a[n], used[n], res = 0, p[n];
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        used[i] = false;
        p[i] = a[i] + (i > 0 ? p[i - 1] : 0);
    }
    for (int i = 0; i < m; i++) {
        int b;
        cin >> b;
        used[b - 1] = true;
    }
    deque<int> mn;
    for (int i = n - 1; i >= 0; i--) {
        while (!mn.empty() && a[i] <= a[mn[0]]) {
            if (sz > 0 && st[0].ind == mn[0]) st.pop_front(), sz--;
            mn.pop_front();
        }
        mn.push_front(a[i]);
        push_front(
                line((long double) 1 / (long double) a[i], (
                                                                   long double) (T - (i > 0 ? p[i - 1] : 0)) /
                                                           (long double) a[i] + i, i));
        while (!mn.empty() && p[mn.back() - 1] - (i > 0 ? p[i - 1] : 0) > T) {
            if (sz > 0 && st.back().ind == mn.back()) st.pop_back(), sz--;
            mn.pop_back();
        }
        if (used[i]) {
            res = max(res, (int) get((i > 0 ? p[i - 1] : 0)) - i);
        }
    }
    reverse(a, a + n);
    for (int i = 0; i < n - i - 1; i++) swap(used[i], used[n - i - 1]);
    mn.clear(), clear();
    for (int i = 0; i < n; i++) p[i] = a[i] + (i > 0 ? p[i - 1] : 0);
    for (int i = n - 1; i >= 0; i--) {
        while (!mn.empty() && a[i] <= a[mn[0]]) {
            if (sz > 0 && st[0].ind == mn[0]) st.pop_front(), sz--;
            mn.pop_front();
        }
        mn.push_front(a[i]);
        push_front(
                line((long double) 1 / (long double) a[i], (
                                                                   long double) (T - (i > 0 ? p[i - 1] : 0)) /
                                                           (long double) a[i] + i, i));
        while (!mn.empty() && p[mn.back() - 1] - (i > 0 ? p[i - 1] : 0) > T) {
            if (sz > 0 && st.back().ind == mn.back()) st.pop_back(), sz--;
            mn.pop_back();
        }
        if (used[i]) {
            res = max(res, (int) get((i > 0 ? p[i - 1] : 0)) - i);
        }
    }
    cout << res;
    return 0;
}