main :: IO () main = do input <- getLine let result = fst . head . filter (\(a, b) -> a /= read b) . zip [1..] $ words input ++ ["-1"] putStrLn . show $ result