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

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

#pragma GCC target("avx2")

using namespace std;
using namespace __gnu_pbds;

using ll = long long;
using ost = tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>;
template <long long N, class T = long long>
using pii = array<T, N>;

int main() {
    ll n, m, t;
    cin >> n >> m >> t;
    constexpr ll mxn = 3e5;//3e5
ll arr[mxn], brr[mxn];
for (ll i = 0; i < n; ++i) cin >> arr[i];
for (ll i = 0; i < m; ++i) cin >> brr[i];

ll mn = 0;
for (ll i = 1; i < m; ++i)
    if (brr[i] < brr[mn]) mn = i;
ll cnt = 0;
for (ll i = brr[mn] - 1; i > 0; --i) {
    if (t < arr[i]){
        t = 0;
        break;
    }
    ++cnt;
    t -= arr[i];
}
cnt += t / arr[0];
cout <<cnt;

    return 0;
}
