N = int(input()) A = [int(i) for i in input().split()] B = [int(i) for i in input().split()] cnt = 0 import itertools as it for i in it.permutations(range(N)): #print(i) for j in it.permutations(range(N)): s = 0 for k in range(N): if A[i[k]]>B[j[k]]: s += 1 if s>N//2: cnt += 1 c = 1 for i in range(1, N+1): c *= i c *= c print(cnt/c)