#include<iostream>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<cstring>
#include<cmath>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;
#define me(a,b) memset(a,b,sizeof(a))
#define inf 0x3f3f3f3f
const int N=500005;
int main()
{
	int t,i,j,m,n,x,y,z,a[4],b,sum=0,c;
	cin>>a[1]>>a[2]>>a[3];
	sort(a+1,a+1+3);
	x=a[3]-a[1];
	y=a[3]-a[2];
	
	sum+=y;
	x-=y;
	if(x%2)
	{x+=1;
		sum+=x/2;
		sum+=1;
	}
	else 
	{
		sum+=x/2;
	}
	cout<<sum;
	return 0; 
}