import itertools n=input() a=map(int,raw_input().split()) b=map(int,raw_input().split()) w=0. a=list(itertools.permutations(a)) b=list(itertools.permutations(b)) for i in a: for j in b: x=0 for k in range(n): if i[k]>j[k]: x+=1 else: x-=1 if x>0: w+=1 print w/(len(a)*len(b))