read*,i,j,k
if(j<i)then
n=i;i=j;j=n
endif
if(k<j)then
n=j;j=k;k=n
endif
if(j<i)then
n=i;i=j;j=n
endif
n=(k-i)/2+(k-j)/2;k=i+j+2*n-k-k
if(k==-1)then
n=n+2
else if(k==-2)then
n=n+1
endif
print"(i0)",n
end