from sys import stdin

def main():

    #入力

    readline=stdin.readline

    a,b,c=list(map(int,readline().split()))



    count=0

    li=[a,b,c]

    li.sort()



    count+=li[2]-li[1]

    li[0]+=li[2]-li[1]

    li[1]+=li[2]-li[1]



    count+=(li[2]-li[0])//2

    li[0]+=((li[2]-li[0])//2)*2



    if li[0]==li[2]:

        print(count)

    else:

        print((count+2))

        

if __name__=="__main__":

    main()
from sys import stdin

def main():

    #入力

    readline=stdin.readline

    a,b,c=list(map(int,readline().split()))



    li=[a,b,c]

    li.sort()

    x=li[0]

    y=li[1]

    z=li[2]



    cnt=0

    cnt+=z-y

    x+=z-y

    y+=z-y

    if (z-x)%2==0:

        cnt+=(z-x)//2

    else:

        cnt+=(z-x+1)//2+1



    print(cnt)

if __name__=="__main__":

    main()
from sys import stdin


def main():
    # 入力
    readline = stdin.readline
    a, b, c = list(map(int, readline().split()))
    count = 0
    li = [a, b, c]
    li.sort()
    count += li[2] - li[1]
    li[0] += li[2] - li[1]
    li[1] += li[2] - li[1]
    count += (li[2] - li[0]) // 2
    li[0] += ((li[2] - li[0]) // 2) * 2
    if li[0] == li[2]:
        print(count)
    else:
        print((count + 2))


if __name__ == "__main__":
    main()

from sys import stdin


def main():
    # 入力
    readline = stdin.readline
    a, b, c = list(map(int, readline().split()))
    li = [a, b, c]
    li.sort()
    x = li[0]
    y = li[1]
    z = li[2]
    cnt = 0
    cnt += z - y
    x += z - y
    y += z - y
    if (z - x) % 2 == 0:
        cnt += (z - x) // 2
    else:
        cnt += (z - x + 1) // 2 + 1
    print(cnt)


if __name__ == "__main__":
    main()

-    count = 0 -    count += li[2] - li[1] -    li[0] += li[2] - li[1] -    li[1] += li[2] - li[1] -    count += (li[2] - li[0]) // 2 -    li[0] += ((li[2] - li[0]) // 2) * 2 -    if li[0] == li[2]: -        print(count) +    x = li[0] +    y = li[1] +    z = li[2] +    cnt = 0 +    cnt += z - y +    x += z - y +    y += z - y +    if (z - x) % 2 == 0: +        cnt += (z - x) // 2 -        print((count + 2)) +        cnt += (z - x + 1) // 2 + 1 +    print(cnt)