from heapq import heappush, heappop N = int(input()) P = list(map(int, input().split())) Q = list(map(int, input().split())) ps = [p/1000 for p in P] qs = [q/100 for q in Q] qu = [] for i, (p, q) in enumerate(zip(ps, qs)): heappush(qu, (-p*q, i)) ans = 0 for i in range(1, 10**6): p, ind = heappop(qu) ans += -p * i heappush(qu, (p * (1-qs[ind]), ind)) print(ans)