b9 = gets.split(' ').map(&:to_i) 1.upto(10) do |i| if i != b9[i-1] puts i break end end