import itertools N=int(raw_input()) A=map(int,raw_input().split()) B=map(int,raw_input().split()) A.sort() tot=0 ans=0.0 for curA in itertools.permutations(A): awin=0 bwin=0 tot+=1 #print curA for i in range(N): if curA[i]>B[i]: awin+=1 if curA[i]bwin: ans+=1 print ans/tot