program name
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int64):: x,y,ans

    read*, x,y
    ans = 2000000000
    if (y-x >= 0) then
        ans=min(ans,y-x)
    end if

    if (y-(-x) >= 0) then
        ans = min(ans,y-(-x)+1)
    end if

    if ((-y) - x >= 0)then
        ans = min(ans,(-y)-x+1)
    end if

    if ((-y)-(-x) >= 0) then
        ans = min(ans,(-y)-(-x)+2)
    end if

    print'(i0)', ans
end program name