from math import factorial cnt = 0 def dfs(depth, N, p, mask): global cnt if depth == N: wc = 0 for i, j in enumerate(p): if A[j] > B[i]: wc += 1 if 2*wc > N: cnt += 1 return for i in range(N): if not(mask & (1 << i)): p[depth] = i dfs(depth + 1, N, p, mask ^ (1 << i)) N = int(input()) A = [int(i) for i in input().split()] B = [int(i) for i in input().split()] p = [0] * N dfs(0, N, p, 0) ans = cnt / factorial(N) print(ans)