N,M,W = map(int,input().split()) A = list(map(int,input().split())) B = list(map(int,input().split())) C = list(map(int,input().split())) t = [] for i,v in enumerate(A): t.append((v,1,v)) for i,v in enumerate(B): t.append((C[i]//B[i],B[i],C[i])) t.sort() #print(t) ans = 0 weight = 0 for i in range(len(t)-1,-1,-1): omosa,value = t[i][1],t[i][2] if weight + omosa <= W: weight += omosa ans += value else: if omosa == 1: print(ans) exit() print(ans)