import qualified Data.IntSet as S

main :: IO ()
main = do
  a <- readLn
  b <- readLn
  print $ solve a b

solve :: Int -> Int -> Int
solve a b = S.findMin $ S.delete b $ S.delete a $ S.fromList [1..3]