n = gets.chomp.to_i a = gets.chomp if a.include?(' ') puts "assert" exit end a = a.to_i b = gets.chomp.to_i c = gets.chomp.to_i puts [a, b, c].combination(2).map{|c| c[0] + c[1]}.sort.uniq.reverse[1]