def gap(a, b):
    x = b - a
    if x < 0:
        x = 10 ** 18
    return x


a, b = [int(i) for i in input().split()]
print(min(gap(a, b), 1 + gap(a, -b), 1 + gap(-a, b), 2 + gap(-a, -b)))

f6bbcc3d237a90a9a2b0e482e7153ffe2f64d53e
<mask token>

def gap(a, b):
    x = b - a
    if x < 0:
        x = 10 ** 18
    return x


<mask token>

def gap(a, b):
    x = b - a
    if x < 0:
        x = 10 ** 18
    return x


<mask token>
print(min(gap(a, b), 1 + gap(a, -b), 1 + gap(-a, b), 2 + gap(-a, -b)))

def gap(a, b):
    x = b - a
    if x < 0:
        x = 10 ** 18
    return x


a, b = [int(i) for i in input().split()]
print(min(gap(a, b), 1 + gap(a, -b), 1 + gap(-a, b), 2 + gap(-a, -b)))
