n,m,t=map(int,input().split())
A=list(map(int,input().split()))
C=list(map(int,input().split()))
i=min(C)-1
z=0
while i!=0:
    if A[i]<=t:
        t-=A[i]
        z+=1
        i-=1
    else:
        break
if i==0:
    z+=t//A[i]
print(z)