Imports System.Collections.Generic
Imports System.Console
Imports System.Math

Module Program
    Sub Main()
        Dim x As Integer = NextInt()
        Dim y As Integer = NextInt()

        Dim cnt As Integer
        Select Case Abs(x) - Abs(y)
            Case Is < 0
                cnt += Int(x < 0)
                cnt += Int(y < 0)
            Case Is > 0
                cnt += Int(x > 0)
                cnt += Int(y > 0)
            Case Is = 0
                cnt += Int(x <> y)
        End Select

        WriteLine(Abs(Abs(x) - Abs(y)) + cnt)
    End Sub

    Function Int(ok As Boolean) As Integer
        If ok Then Return 1
        Return 0
    End Function

    Function NextInt() As Integer
        Return CInt(NextString())
    End Function

    Function NextString() As String
        Dim result As New List(Of Char)
        Do
            Dim tmp As Integer = Read()
            If tmp < 0 Then Exit Do
            Dim nextChar As Char = Chr(tmp)

            If Not Char.IsWhiteSpace(nextChar) Then
                result.Add(nextChar)
            ElseIf nextChar <> vbCr Then
                Exit Do
            End If
        Loop
        Return New String(result.ToArray())
    End Function

End Module
