from random import shuffle N = int(input()) A = list(map(int,input().split())) B = list(map(int,input().split())) s = 0 t = 0 for _ in range(100000): shuffle(A) shuffle(B) cnt = 0 for i in range(N): if A[i] > B[i]: cnt += 1 if A[i] < B[i]: cnt -= 1 if cnt >= 1: s += 1 t += 1 print(s / t)