let i=readLine()!.characters.split(" ").map{Int(String($0))!},x=i[0],y=i[1]
var ans=Int(2e9)
func f(x:Int, _ y:Int, _ a:Int) {
  if y <= x {
    ans=min(ans,y-x+a)
  }
}
f(x,y,0)
f(x,-y,1)
f(-x,y,1)
f(-x,-y,2)
print(ans)