sub main()
  dim a as integer, b as integer
  dim ans as integer
  dim i
  
  a = Console.ReadLine()
  b = Console.ReadLine()
  
  For i = 1 to 3
  if not (a = i Or b = i) then
    ans = i
    Exit For
  end if
next
  
Console.WriteLine(ans)
  
end sub