from heapq import heappop,heappush n=int(input()) P=list(map(int,input().split())) Q=list(map(int,input().split())) X=[] for i in range(n): X.append((-P[i]*Q[i]/100000,1-Q[i]/100)) X.sort() ANS=0 for tests in range(1,9999): x,y=heappop(X) ANS+=-x*tests heappush(X,(x*y,y)) print(ANS)