from itertools import permutations n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) p = list(permutations(a)) m = len(p) win = 0 for i in range(m): cnt = 0 for j in range(n): if p[i][j] > b[j]: cnt += 1 if cnt > n / 2: win += 1 print(win / m)