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

    read*, x,y
    d = abs(y)-abs(x)
    ans=d
    if (x>=0 .neqv. y>=0) ans=ans+1
    if (d>=0 .neqv. (x>=0 .or. y>=0))ans=ans+2
    print'(i0)', ans
end program name