from heapq import heappop, heappush n = int(input()) p_ls = map(lambda p: int(p) / 1000, input().split()) q_ls = map(lambda q: int(q) / 100, input().split()) hq = [] for p, q in zip(p_ls, q_ls): heappush(hq, (-p * q, 1 - q)) ans = 0 for i in range(1, 1000000): t, tq = heappop(hq) ans += -i * t heappush(hq, (t * tq, tq)) print(ans)