N = gets.to_i A = (1..N).map {gets.to_i} ans = A.map {|a| a / A.inject(&:gcd)}.inject(:+) puts ans