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