import Data.List

main=do
    [x,y]<-map read.words<$>getLine
    print $ sol x y
sol x y
    | x<0 && y==0 = -x
    | x>0 && y==0 = x+1
    | x==0 && y<0 = 1-y
    | x==0 && y>0 = y
    | x<0 && y<0 && x<y = y-x
    | x<0 && y<0 && x>y = x-y+2
    | x<0 && y>0 = y-x
    | x>0 && y<0 = x+y+1
    | x < y = y-x
    | x > y = x-y+2
