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