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