import itertools import math N = int(input()) A = list(map(int,input().split())) B = list(map(int,input().split())) win = 0 for v in itertools.permutations(A, N): check = 0 for n in range(N): if v[n] < B[n]: check += 1 if check < N/2: win += 1 print(win/math.factorial(N))