#include <bits/stdc++.h>
// #pragma GCC optimize("O3")
// #pragma GCC target("avx2")
#define LOCAL

// std::mt19937 rnd(time(0));

void solve();

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

    #ifdef LOCAL
        std::freopen("input.txt", "r", stdin);
        std::freopen("output.txt", "w", stdout);
    #endif

    int t = 1;
    // std::cin >> t;

    while (t--) {
        solve();
    }

    return 0;
}

class SegmentTree {
 private:
    std::vector <int> body;

    inline void build(int curV, int l, int r, std::vector <int> &array) {
        if (l == r - 1) {
            body[curV] = array[l];
            return;
        }

        int m = (l + r) / 2;
        build(curV * 2 + 1, l, m, array);
        build(curV * 2 + 2, m, r, array);

        body[curV] = std::min(body[curV * 2 + 1], body[curV * 2 + 2]);
    }

 public:
    SegmentTree (std::vector <int> &array) {
        body.resize(4 * (int) array.size());
        build(0, 0, (int) array.size(), array);
    }

    inline int get(int curV, int l, int r, int ql, int qr) {
        if (r <= ql || qr <= l) return INT_MAX;

        if (ql <= l && r <= qr) return body[curV];

        int m = (l + r) / 2;
        return std::min(get(curV * 2 + 1, l, m, ql, qr), get(curV * 2 + 2, m, r, ql, qr));
    }
};

void solve() {
    int n, m, T;
    std::cin >> n >> m >> T;

    std::vector <int> lens(n);
    std::set <int> starts;

    for (int i = 0; i < n; ++i) {
        std::cin >> lens[i];
    }
    for (int i = 0; i < m; ++i) {
        int x;
        std::cin >> x;

        --x;

        starts.insert(x);
    }

    std::vector <long long> prefSum(n, lens[0]);
    for (int i = 1; i < n; ++i) {
        prefSum[i] = prefSum[i - 1] + lens[i];
    }

    int res = 0;
    for (int i = 0; i < n; ++i) {
        auto r = starts.lower_bound(i);
        auto l = r;
        if (l != starts.begin()) {
            --l;
        }

        if (r != starts.end() && *r < n && i <= *r) {
            int curRes = (T - (prefSum[*r] - prefSum[i])) / lens[i] + *r - i;
            res = std::max(curRes, res);
        }
        if (i > 0 && l != starts.end() && *l < i) {
            int curRes = (T - (prefSum[i - 1] - prefSum[*l] + lens[*l])) / lens[i] + i - *l;
            res = std::max(curRes, res);
        }
    }

    std::cout << res;
}