#pragma GCC optimize("O3,unroll-loops")

#include <bits/stdc++.h>

using namespace std;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

// #pragma GCC target("sse4.2,bmi,bmi2,popcnt,lzcnt,avx2")

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef __int128_t d128;
typedef ll dgt;
typedef pair<dgt, dgt> pdd;
const dgt MOD = 1e9 + 7;
const dgt INF = 1e9 + 1;
const ll INFLL = 1e18 + 1;
const ld EPS = 1e-9;

// typedef tree<dgt, null_type, less<dgt>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

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

template<typename T1, typename T2>
istream& operator >> (istream&, pair<T1, T2>&);

template<typename T1, typename T2>
ostream& operator << (ostream&, const pair<T1, T2>&);

template<typename T>
istream& operator >> (istream& is, vector<T>& arr) {
    for (T& el: arr)
        is >> el;
    return is;
}

template<typename T>
ostream& operator << (ostream& os, const vector<T>& arr) {
    for (const T& el: arr)
        os << el << ' ';
    return os;
}

template<typename T1, typename T2>
istream& operator >> (istream& is, pair<T1, T2>& pr) {
    return is >> pr.first >> pr.second;
}

template<typename T1, typename T2>
ostream& operator << (ostream& os, const pair<T1, T2>& pr) {
    return os << pr.first << ' ' << pr.second;
}

struct LiChao {
    struct line {
        ld k, b;
    };
    
    line DEFAULT = {0, -INFLL};

    vector<line> tree;
    vector<dgt> lch, rch;
    vector<dgt> num;
    dgt size, root;

    ld calc(line l, dgt x) {
        return l.k * x + l.b;
    }

    LiChao(dgt n) {
        build(n);
    }

    void build(dgt n) {
        for (size = 1; size < n; size *= 2);
        tree.clear(), num.clear(), lch.clear(), rch.clear();
        root = _create(-1);
    }

    dgt _create(dgt n) {
        if (n == -1) {
            n = tree.size();
            tree.push_back(DEFAULT);
            num.push_back(-1);
            lch.push_back(-1);
            rch.push_back(-1);
        }
        return n;
    }

    void _add(dgt v, dgt l, dgt r, line ln, dgt i) {
        if (l + 1 == r) {
            if (calc(ln, l) > calc(tree[v], l)) {
                tree[v] = ln, num[v] = i;
            }
            return;
        }
        dgt m = (l + r) / 2;
        if (calc(ln, m) > calc(tree[v], m)) {
            swap(ln, tree[v]);
            swap(i, num[v]);
        }
        if (calc(ln, l) > calc(tree[v], l)) {
            lch[v] = _create(lch[v]);
            _add(lch[v], l, m, ln, i);
        }
        else if (calc(ln, r - 1) > calc(tree[v], r - 1)) {
            rch[v] = _create(rch[v]);
            _add(rch[v], m, r, ln, i);
        }
    }

    void add(ld k, ld b, dgt i) {
        return _add(root, 0, size, {k, b}, i);
    }

    dgt get(dgt pos) {
        dgt ind = -1;
        ld val = -INFLL;
        dgt v = root, l = 0, r = size;
        while(v != -1) {
            ld new_val = calc(tree[v], pos);
            if (new_val > val) {
                ind = num[v];
                val = new_val;
            }
            dgt m = (l + r) / 2;
            if (pos < m)
                v = lch[v], r = m;
            else
                v = rch[v], l = m;
        }
        return ind;
    }
};

vector<dgt> prefa, a;
dgt n, t;
vector<dgt> buf;

struct MST1 {
    vector<LiChao> tree;
    dgt size;

    MST1(dgt n) {
        build(n);
    }

    void build(dgt n) {
        for (size = 1; size < n; size *= 2);
        tree.assign(2 * size - 1, n * INF);
        _build(0, 0, size);
    }

    void _build(dgt v, dgt l, dgt r) {
        if (l >= a.size())
            return;
        for (dgt i = l; i < r && i < n; ++i)
            tree[v].add(-1.0l / ld(a[i]), ld(t + prefa[i + 1]) / ld(a[i]) - i, i);
        if (l + 1 < r) {
            dgt m = (l + r) / 2;
            _build(2 * v + 1, l, m);
            _build(2 * v + 2, m, r);
        }
    }

    void _get(dgt v, dgt l, dgt r, dgt ql, dgt qr, dgt x) {
        if (qr <= l || ql >= r)
            return;
        if (ql <= l && qr >= r) {
            buf.push_back(tree[v].get(x));
            return;
        }
        dgt m = (l + r) / 2;
        _get(2 * v + 1, l, m, ql, qr, x);
        _get(2 * v + 2, m, r, ql, qr, x);
    }

    void get(dgt ql, dgt qr, dgt x) {
        buf.clear();
        return _get(0, 0, size, ql, qr, x);
    }
};

struct MST2 {
    vector<LiChao> tree;
    dgt size;

    MST2(dgt n) {
        build(n);
    }

    void build(dgt n) {
        for (size = 1; size < n; size *= 2);
        tree.assign(2 * size - 1, n * INF);
        _build(0, 0, size);
    }

    void _build(dgt v, dgt l, dgt r) {
        if (l >= a.size())
            return;
        for (dgt i = l; i < r && i < n; ++i)
            tree[v].add(1.0l / a[i], ld(t - prefa[i]) / ld(a[i]) + i, i);
        if (l + 1 < r) {
            dgt m = (l + r) / 2;
            _build(2 * v + 1, l, m);
            _build(2 * v + 2, m, r);
        }
    }

    void _get(dgt v, dgt l, dgt r, dgt ql, dgt qr, dgt x) {
        if (qr <= l || ql >= r)
            return;
        if (ql <= l && qr >= r) {
            buf.push_back(tree[v].get(x));
            return;
        }
        dgt m = (l + r) / 2;
        _get(2 * v + 1, l, m, ql, qr, x);
        _get(2 * v + 2, m, r, ql, qr, x);
    }

    void get(dgt ql, dgt qr, dgt x) {
        buf.clear();
        return _get(0, 0, size, ql, qr, x);
    }
};

void solve() {
    dgt m;
    cin >> n >> m >> t;
    a.resize(n);
    cin >> a;
    bitset<300000> is;
    is.reset();
    prefa.assign(n + 1, 0);
    for (dgt i = 1; i <= n; ++i) {
        prefa[i] = prefa[i - 1] + a[i - 1];
    }
    for (dgt i = 0; i < m; ++i) {
        dgt b;
        cin >> b;
        --b;
        is[b] = true;
    }
    dgt ans = 0;
    // LiChao consist(n * INF);
    MST1 mst1(n);
    for (dgt i = 0; i < n; ++i) {
        // consist.add(-1.0l / ld(a[i]), ld(t + prefa[i + 1]) / ld(a[i]) - i, i);
        if (!is[i])
            continue;
        // dgt ind = consist.get(prefa[i + 1]);
        // if (prefa[i + 1] - prefa[ind + 1] <= t) {
        //     dgt k = i - ind + (t - (prefa[i + 1] - prefa[ind + 1])) / a[ind];
        //     ans = max(ans, k);
        // }
        if (a[i] <= t) {
            dgt left = -1;
            dgt right = i;
            while (left + 1 < right) {
                dgt mid = (left + right) / 2;
                if (prefa[i + 1] - prefa[mid] <= t)
                    right = mid;
                else
                    left = mid;
            }
            mst1.get(right, i + 1, prefa[i + 1]);
            for (dgt ind: buf) {
                if (ind == -1)
                    continue;
                dgt k = i - ind + (t - (prefa[i + 1] - prefa[ind + 1])) / a[ind];
                ans = max(ans, k);
            }
            // dgt ind = right;
        }
    }
    // consist.build(n * INF);
    mst1.tree.clear();
    mst1.tree.shrink_to_fit();
    MST2 mst2(n);
    for (dgt i = n - 1; i >= 0; --i) {
        // consist.add(1.0l / a[i], ld(t - prefa[i]) / ld(a[i]) + i, i);
        if (!is[i])
            continue;
        // dgt ind = consist.get(prefa[i]);
        // if (prefa[ind] - prefa[i] <= t) {
        //     dgt k = ind - i + (t - (prefa[ind] - prefa[i])) / a[ind];
        //     ans = max(ans, k);
        // }
        if (a[i] <= t) {
            dgt right = n;
            dgt left = i;
            while (left + 1 < right) {
                dgt mid = (left + right) / 2;
                if (prefa[mid + 1] - prefa[i] <= t)
                    left = mid;
                else
                    right = mid;
            }
            // ind = left;
            mst2.get(i, left + 1, prefa[i]);
            for (dgt ind: buf) {
                if (ind == -1)
                    continue;
                dgt k = ind - i + (t - (prefa[ind] - prefa[i])) / a[ind];
                ans = max(ans, k);
            }
        }
    }
    cout << ans << '\n';
}

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int reps = 1;
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    cin >> reps;
#endif

    for (int i = 0; i < reps; ++i) {
#ifdef LOCAL
        cout << "Test case #" << i << " ===========================\n";
#endif
        solve();
#ifdef LOCAL
        cout << "End test ===============================\n";
#endif
    }

    return 0;
}

// g++ -std=c++23 -Wall -Wextra -Wshadow -O2 -DLOCAL -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -fsanitize=address,undefined
