#include<iostream>
#include<cstdio>
#include<string>
#include<map>
#include<queue>
#include<cmath>
using namespace std;
#define ll long long
const ll len=1e3+5;
int main()
{
	ll a,b,c;
	ll sum=0;
	while(cin>>a>>b>>c)
	{
		sum=0;
		ll maxm=-1;
		maxm=max(maxm,a);
		maxm=max(maxm,b);
		maxm=max(maxm,c);
		sum+=(maxm-a)/2;
		sum+=(maxm-b)/2;
		sum+=(maxm-c)/2;
		sum+=((maxm-a)%2+(maxm-b)%2+(maxm-c)%2)/2;
		cout<<sum<<endl;
	}
} 