#import collections

#aa = collections.Counter(a) # list to list

#from itertools import combinations # (string,3) 3回



mod = 10**9 + 7



def readInts():

  return list(map(int,input().split()))

def main():

    a,b,c = readInts()

    if (max(a,b,c)*3 - a - b - c) % 2 == 0:# 3 4 5  5 * 3 = 15 15 - 12 = 3

        print(((max(a,b,c)*3 - a - b - c)//2))

    else:

        print((((max(a,b,c)*3 - a - b - c) //2)+2)) # 3 4 5 (1+2) 

if __name__ == '__main__':

  main()

#from statistics import median

#import collections

#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]

#from itertools import combinations # (string,3) 3回

#from collections import deque

#import collections.defaultdict

#import bisect

#

#    d = m - k[i] - k[j]

#    if kk[bisect.bisect_right(kk,d) - 1] == d:

#

#

#

# pythonで無理なときは、pypyでやると正解するかも！！

#

#



import sys

sys.setrecursionlimit(10000)

mod = 10**9 + 7



def readInts():

  return list(map(int,input().split()))

def main():

    a,b,c = readInts()

    # 二つの構成で、合計結局偶数個増えることが分かる

    d = max(a,b,c)*3 - a - b - c

    if d % 2 == 0:

        # 偶数なら、

        print((d//2))

        # 1回で2個

    else:#奇数なら、

        print((d//2 + 2))

        # 条件1, 条件2を結局1回ずつ増やす

if __name__ == '__main__':

  main()

# import collections
# aa = collections.Counter(a) # list to list
# from itertools import combinations # (string,3) 3回
mod = 10**9 + 7


def readInts():
    return list(map(int, input().split()))


def main():
    a, b, c = readInts()
    if (max(a, b, c) * 3 - a - b - c) % 2 == 0:  # 3 4 5  5 * 3 = 15 15 - 12 = 3
        print(((max(a, b, c) * 3 - a - b - c) // 2))
    else:
        print((((max(a, b, c) * 3 - a - b - c) // 2) + 2))  # 3 4 5 (1+2)


if __name__ == "__main__":
    main()

# from statistics import median
# import collections
# aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
# from itertools import combinations # (string,3) 3回
# from collections import deque
# import collections.defaultdict
# import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
import sys

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


def readInts():
    return list(map(int, input().split()))


def main():
    a, b, c = readInts()
    # 二つの構成で、合計結局偶数個増えることが分かる
    d = max(a, b, c) * 3 - a - b - c
    if d % 2 == 0:
        # 偶数なら、
        print((d // 2))
        # 1回で2個
    else:  # 奇数なら、
        print((d // 2 + 2))
        # 条件1, 条件2を結局1回ずつ増やす


if __name__ == "__main__":
    main()

+# from statistics import median -# aa = collections.Counter(a) # list to list +# aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0] +# from collections import deque +# import collections.defaultdict +# import bisect +# +#    d = m - k[i] - k[j] +#    if kk[bisect.bisect_right(kk,d) - 1] == d: +# +# +# +# pythonで無理なときは、pypyでやると正解するかも！！ +# +# +import sys + +sys.setrecursionlimit(10000) -    if (max(a, b, c) * 3 - a - b - c) % 2 == 0:  # 3 4 5  5 * 3 = 15 15 - 12 = 3 -        print(((max(a, b, c) * 3 - a - b - c) // 2)) -    else: -        print((((max(a, b, c) * 3 - a - b - c) // 2) + 2))  # 3 4 5 (1+2) +    # 二つの構成で、合計結局偶数個増えることが分かる +    d = max(a, b, c) * 3 - a - b - c +    if d % 2 == 0: +        # 偶数なら、 +        print((d // 2)) +        # 1回で2個 +    else:  # 奇数なら、 +        print((d // 2 + 2)) +        # 条件1, 条件2を結局1回ずつ増やす