from itertools import permutations N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) win_A = 0 p = 0 for a in permutations(A, N): for b in permutations(B, N): p += 1 x = y = 0 for i in range(N): if b[i] < a[i]: x += 1 else: y += 1 if y < x: win_A += 1 print(win_A/p)