#yukicoderNO.113 n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) def makepop(now,card,ans): if len(card)==0: ans.append(now) return ans for i in range(len(card)): nextcard=card.copy() x=nextcard.pop(i) nex=now+[x] ans=makepop(nex,nextcard,ans) return ans apop=makepop([],a,[]) bpop=makepop([],b,[]) win,match=0,0 def battle(x,y): point=0 for i in range(len(x)): if x[i]>y[i]:point+=1 if point>len(x)/2:return 1 else:return 0 for x in apop: for y in bpop: win+=battle(x,y) match+=1 print(win/match)