n = int(input()) *a, = map(int,input().split()) *b, = map(int,input().split()) from itertools import permutations ans = 0 for pa in permutations(a): for pb in permutations(b): if sum(u > v for u,v in zip(pa,pb)) > n//2: ans += 1 print(ans/([0,1,2,6,24][n]**2))