import heapq import time n = int(input()) p = list(map(lambda x: int(x) / 1000, input().split())) q = list(map(lambda x: int(x) / 100, input().split())) pq = [] for pi, qi in zip(p, q): heapq.heappush(pq, (-pi * qi, qi)) start = time.time() k = 1 ans = 0 while time.time() - start < 1.95: pro, qq = heapq.heappop(pq) ans += -pro * k k += 1 heapq.heappush(pq, (pro * (1 - qq), qq)) print(ans)