You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order:    * Choose two among A, B and C, then increase both by 1.   * Choose one among A, B and C, then increase it by 2.  It can be proved that we can always make A, B and C all equal by repeatedly performing these operations.
# -*- coding: utf-8 -*-
"""
Created on Wed Aug  8 12:24:08 2018

@author: Yuki
"""

A, B, C = map(int, input().split())
min_of_int = min(min(A, B), C)
A -= min_of_int
B -= min_of_int
C -= min_of_int

sum_of_delta = A + B + C
if sum_of_delta % 2 == 0:
    print(sum_of_delta//2)
else:
    print(sum_of_delta//2 + 1)

# -*- coding: utf-8 -*-
"""
Created on Wed Aug  8 12:24:08 2018

@author: Yuki
"""

A, B, C = map(int, input().split())
min_of_int = min(min(A, B), C)
A -= min_of_int
B -= min_of_int
C -= min_of_int

max_of_int = max(A, max(B, C))
sum_of_delta = 3 * max_of_int - (A + B + C)

if sum_of_delta % 2 == 0:
    print(sum_of_delta//2)
else:
    print(sum_of_delta//2 + 2)
