N=gets.to_i a=gets.split.map &:to_i b=[1] 1.step(N-1){|i|b[i]=Rational(b[i-1]*a[i-1],a[i])} puts 1/b[N-1]