N = gets.to_i A = gets.split.map(&:to_i) B = gets.split.map(&:to_i) n = 0 d = 0 B.permutation do |b| w = A.zip(b).select{|a| a[0] > a[1]}.size l = N - w n += 1 if w > l d += 1 end puts Rational(n, d).to_f