from itertools import permutations N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) game, win = 0, 0 for X in permutations(B, N): game += 1 cnt = 0 for a, b in zip(A, X): if a > b: cnt += 1 if 2*cnt > N: win += 1 print(win/game)