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 p, q in zip(ps, qs): heappush(qu, (-p*q, q)) ans = 0 for i in range(1, 10**6): p, q = heappop(qu) ans += -p * i heappush(qu, (p * (1-q), q)) print(ans)