program	proa
	implicit none
	integer :: a,b
    read(*,*) a,b
    if (a /= 1 .and. b /= 1) then
    	write(*,*) "1"
    else if (a /= 2 .and. b /= 2) then
    	write(*,*) "2"
    else
    	write(*,*) "3"
    end if
    
	stop
end program proa