#!/usr/bin/env python3 # -*- coding: utf-8 -*- import random import statistics EXP_TIMES = 50000 def judge(pair): if pair[0] > pair[1]: return 1 else: return 0 def conduct_experiment(n, acs, bcs): random.shuffle(acs) random.shuffle(bcs) w = sum(map(judge, zip(acs, bcs))) if w > n - w: return 1.0 else: return 0.0 def main(times=EXP_TIMES): n = int(input()) acs = list(map(int, input().split())) bcs = list(map(int, input().split())) ans = statistics.mean(conduct_experiment(n, acs, bcs) for x in range(times)) print("{ans:.5f}".format(ans=ans)) if __name__ == "__main__": main()