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