import Prelude

main :: IO ()
main = do
  bs <- map read . words <$> getLine
  print $ calc bs

calc :: [Int] -> Int
calc bs = head $ filter (flip notElem bs) [1..10]