import itertools def main(): N = int(input()) *A, = map(int, input().split()) *B, = map(int, input().split()) t, s = 0, 0 for Ap in itertools.permutations(A): w = [a > b for a, b in zip(Ap, B)] t += sum(w) * 2 > N s += 1 print(t/s) if __name__ == '__main__': main()