from itertools import permutations N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) total, vic = 0, 0 for a in permutations(A): for b in permutations(B): total += 1 cnt = 0 for i in range(N): if a[i] > b[i]: cnt += 1 if cnt > N // 2: vic += 1 print(vic / total)