open System

let [|x; y|] = stdin.ReadLine().Split() |> Array.map int

if x <= 0 && y <= 0 || x >= 0 && y >= 0 then
    if x > y then 2 + x - y + (if y = 0 then -1 else 0)
    else y - x
else
    let x = abs(x)
    let y = abs(y)
    if x > y then 1 + x - y
    else 1 + y - x
|> stdout.WriteLine
