from itertools import permutations
from math import factorial
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

win = 0
for A in permutations(a):
    for B in permutations(b):
        cnt = 0
        for i in range(n):
            if A[i] > B[i]:
                cnt += 1
        if cnt > n//2:
            win += 1

print(win/factorial(n)/factorial(n))