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