import itertools n = int(input()) a = map(int, input().split(' ')) b = map(int, input().split(' ')) x = 0 y = 0 A = list(itertools.permutations(a)) B = list(itertools.permutations(b)) for a in A: for b in B: win = 0 lose = 0 for i in range(n): if a[i] > b[i]: win+=1 elif a[i] < b[i]: lose += 1 if win > lose: x += 1 y += 1 print(x/y)