program ABC148A
    implicit none
    integer(8)::A,B,i
    integer(8),dimension(3)::L
    read(5,*)A,B
    L=0
    L(A)=1
    L(B)=1
    do i=1,3
        if(L(i)==0)then
            print'(i0)',i
        end if
    end do

end program ABC148A