program main
implicit None
	integer::a,b,c,p,q
	
	read*,a,b,c
	
	if(b < a)then
		p = a;a = b;b = p
	endif
	
	if(c < b)then
		p = b;b = c;c = p
	endif
	
	if(b < a)then
		p = a;a = b;b = p
	endif
	
	p =(c-a)/2;a = a+2*p
	q =(c-b)/2;b = b+2*q
	
	c = a+b-c-c
	
	if (c == 0)then
		p = p+q
		else if(c == -1)then
		p = p+q+2
		else
		p = p+q+1
	endif
	
	print "(i0)",p
end program main