n, m, T = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

p = min(b)
ans = 0
for i in range(p - 1, -1, -1):
    if a[i] > T:
        break
    ans += 1
    T -= a[i]
else:
    ans += T // a[0]
print(ans)
