import sys
from itertools import permutations
from math import factorial
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり


N = I()
A,B = LI(),LI()

A_win = 0
for X in permutations(B,N):
    count = 0
    for i in range(N):
        if A[i] > X[i]:
            count += 1
    if count > N//2:
        A_win += 1

print(A_win/factorial(N))