from itertools import permutations, product def int_or_float(n): return int(n) if n%1 == 0 else n n = int(input()) a, b = [list(map(int, input().split(" "))) for _ in range(2)] print(int_or_float(sum(sum(a_i>b_i for a_i, b_i in zip(*x)) > n/2 for x in list(product(permutations(a, n), permutations(b, n)))) / n**2))