B = gets.chomp.split puts (1..10).find {|i| i != B[i-1].to_i}