from itertools import permutations n = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) t, win = 0, 0 for a in permutations(A): for b in permutations(B): cnt = 0 t += 1 for ai, bi in zip(a, b): if bi < ai: cnt += 1 if len(b)/2 < cnt: win += 1 print(win/t)