from itertools import permutations, product n = int(input()) a, b = [list(map(int, input().split(" "))) for _ in range(2)] print(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)))) / 2**n)