program AGC008A
    implicit none
    integer(8)::x,y
    integer(8)::result=0
    read(5,*)x,y

    result=result+abs(abs(x)-abs(y))

    if(x*y>0 .and. x>y)then
        result=result+2
    else if(x*y<0)then
        result=result+1
    end if

    print'(i0)',result

end program AGC008A