main=do
    [x,y]<-map read.words<$>getLine
    print $ sol x y
sol x y =  minimum $ map (uncurry (+)) $ filter (\(a,_)->a>0) [(axx,0),(a00,0),(a10,1),(a01,1),(a11,2)]
    where
        axx = if x+y==0 then 1 else -1
        a00 = y-x
        a10 = y-(-x)
        a01 = (-y)-x
        a11 = (-y)-(-x)
