from itertools import permutations, product
from math import factorial

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)))) / factorial(n)**2))