from collections import Counter,defaultdict,deque

import sys,heapq,bisect,math,itertools,string,queue

sys.setrecursionlimit(10**8)

mod = 10**9+7

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpl_str(): return list(sys.stdin.readline().split())

def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))



a = inpl()

a.sort()

b = (a[1]-a[0]) // 2

c = a[2] - a[1]

if (a[1] - a[0]) % 2 == 0:

    print((b + c))

else:

    print((b + c + 2))
from collections import Counter,defaultdict,deque

from heapq import heappop,heappush,heapify

import sys,bisect,math,itertools,fractions,copy

sys.setrecursionlimit(10**8)

mod = 10**9+7

INF = float('inf')

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))



x = inpl()

a,b,c = sorted(x)

n = c-a; m = c-b

res = n//2 + m//2

if n%2 != m%2:

    res += 2

elif n%2 == 1 and n%2 == 1:

    res += 1

print(res)
from collections import Counter, defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue

sys.setrecursionlimit(10**8)
mod = 10**9 + 7


def inp():
    return int(sys.stdin.readline())


def inpl():
    return list(map(int, sys.stdin.readline().split()))


def inpl_str():
    return list(sys.stdin.readline().split())


def inpln(n):
    return list(int(sys.stdin.readline()) for i in range(n))


a = inpl()
a.sort()
b = (a[1] - a[0]) // 2
c = a[2] - a[1]
if (a[1] - a[0]) % 2 == 0:
    print((b + c))
else:
    print((b + c + 2))

from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heapify
import sys, bisect, math, itertools, fractions, copy

sys.setrecursionlimit(10**8)
mod = 10**9 + 7
INF = float("inf")


def inp():
    return int(sys.stdin.readline())


def inpl():
    return list(map(int, sys.stdin.readline().split()))


x = inpl()
a, b, c = sorted(x)
n = c - a
m = c - b
res = n // 2 + m // 2
if n % 2 != m % 2:
    res += 2
elif n % 2 == 1 and n % 2 == 1:
    res += 1
print(res)

-import sys, heapq, bisect, math, itertools, string, queue +from heapq import heappop, heappush, heapify +import sys, bisect, math, itertools, fractions, copy +INF = float("inf") -def inpl_str(): -    return list(sys.stdin.readline().split()) - - -def inpln(n): -    return list(int(sys.stdin.readline()) for i in range(n)) - - -a = inpl() -a.sort() -b = (a[1] - a[0]) // 2 -c = a[2] - a[1] -if (a[1] - a[0]) % 2 == 0: -    print((b + c)) -else: -    print((b + c + 2)) +x = inpl() +a, b, c = sorted(x) +n = c - a +m = c - b +res = n // 2 + m // 2 +if n % 2 != m % 2: +    res += 2 +elif n % 2 == 1 and n % 2 == 1: +    res += 1 +print(res)