from itertools import permutations import math N = int(input()) A = list(map(int,input().split())) B = list(map(int,input().split())) win = 0 for x in permutations(B,N): cnt = 0 for i in range(N): if A[i]>x[i]: cnt += 1 if cnt>N-cnt: win += 1 print(win/math.factorial(N))