let choice a b =
  if a = 1 && b = 2 then 3
  else if a = 1 && b = 3 then 2
  else if a = 2 && b = 1 then 3
  else if a = 2 && b = 3 then 1
  else if a = 3 && b = 1 then 2
  else 1

let ans = choice (read_int ()) (read_int())

let () = print_endline @@ string_of_int ans
