#include <bits/stdc++.h>
using namespace std;


#define fi  first
#define se  second
#define mp  make_pair
#define pb  push_back
#define pf  push_front
#define in  insert

#define all(x) x.begin(),x.end()
#define FOR(i,j,k) for(ll i=j;i<k;i++)
#define REV(i,j,k) for(ll i=j;i>k;i--)
#define mnn (long long) -1000000000000000
#define mxn (long long) 1000000000000000

typedef unsigned long long ull;
typedef long long ll;
typedef vector<ll> vll;
typedef map<ll, ll> mll;
typedef pair<ll, ll> pll;

#define sl(x) scanf("%lld",&x)
#define sll(x,y) scanf("%lld %lld",&x,&y)
#define slll(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define sd(x) scanf("%lf",&x)
#define sdd(x,y) scanf("%lf%lf",&x,&y)
#define sddd(x,y,z) scanf("%lf%lf%lf",&x,&y,&z)
#define ss(str) scanf("%s",str)

#define input freopen("input.txt", "r", stdin)
#define output freopen("output.txt", "w", stdout)
#define fast_io ios_base::sync_with_stdio(0);cin.tie(0);


const int maxn  =     1e6+10;
const double pi =     2.0*acos(0.0);
const double EPS=     1e-11;

/// Binary Segment

/*

ll _LeftIP_BinarySearch(ll st,ll nd,ll key,ll *_Arr)
{
    if(st>nd) return st;
    ll md= (st+nd)>>1 ;
    if(_Arr[md]>=key) return _LeftIP_BinarySearch(st,md-1,key,_Arr);
    else return _LeftIP_BinarySearch(md+1,nd,key,_Arr);

}

ll _RightIP_BinarySearch(ll st,ll nd,ll key,ll *_Arr)
{
    if(st>nd) return st;
    ll md= (st+nd)>>1 ;
    if(_Arr[md]>key) return _RightIP_BinarySearch(st,md-1,key,_Arr);
    else return _RightIP_BinarySearch(md+1,nd,key,_Arr);
}

ll _CountByBinarySearch(ll st,ll nd, ll key,ll *_Arr)
{
    if(st>nd) return 0;
    ll md= (st+nd)>>1 ;
    if(_Arr[md]>key) return _CountByBinarySearch(st,md-1,key,_Arr);
    else if (_Arr[md]<key)  return _CountByBinarySearch(md+1,nd,key,_Arr);
    else return 1 + _CountByBinarySearch(st,md-1,key,_Arr)+ _CountByBinarySearch(md+1,nd,key,_Arr);
}

ll _BinarySearch(ll st,ll nd,ll key,ll *_Arr)
{
    if(st>nd) return 0;
    ll md= (st+nd)>>1 ;
    if(_Arr[md]>key) return _BinarySearch(st,md-1,key,_Arr);
    else if (_Arr[md]<key)  return _BinarySearch(md+1,nd,key,_Arr);
    return md;
}

*/


/// Number theory

/*
bool _Primes[1000005];
void _GeneratePrimes()
{
    ll lim=sqrt(1000004);
    for(ll i=4;i<=1000004;i+=2) _Primes[i]=true;
    _Primes[1]=true; _Primes[0]=true;
    for(ll i=3;i<=lim+1;i+=2)
    {
        if(!_Primes[i]) for(ll j = i*i; j<=1000000;j+=i) _Primes[j]=true;
    }
}
*/

ll gcd(ll x,ll y )
{
    if(y==0) return x;
    return gcd(y,x%y);
}
ll lcm(ll x,ll y)
{
    return (x*y)/gcd(x,y);
}
ll glcm(ll x,ll y,ll gcd)
{
    return (x*y)/gcd;
}


ll sumDigit(ll n)
{
    if (n == 0)
       return 0;
    return (n % 10 + sumDigit(n / 10));
}

 ll _pow(ll n,ll mod)
 {
     if(n==0) return 1;
     ll k=_pow(n/2,mod);
     k=(k*k)%mod;
     if(n%2) k=(k*2)%mod;
     return k;
 }

 bool _isPrime(ll n)
 {
     if(n==2) return true;
     if(n<2 || n%2==0) return false;
     for(ll i=3;i*i<=n;i+=2)
        if(n%i==0) return false;
     return true;
 }
 bool isPowerOfTwo(ll n)
{
   return (ceil(log2(n)) == floor(log2(n)));
}
ll CountBit1(ull num)
{
    ull one=1,cnt=0;
    FOR(i,0,64)
    {
        ll tone=one;
        tone&=num;
        if(tone) cnt++;
        one<<=1;
    }
    return cnt;
}

ll toNum(string s)
{
    ll ret = 0, sig = 1, i=0;
    if(!s.empty() && s[0] == '-') sig = -1, i++;
    while(i < s.size() && s[i] >= '0' && s[i] <= '9')
        ret = ret * 10 + (s[i++] - '0');
    return ret*sig;
}
string toStr(ll x)
{
    string s = "";
	if (x == 0) return "0";
	while(x > 0)
	{
		s = (char)('0' + (x % 10)) + s;
		x /= 10;
	}
	return s;
}

///Direction


ll row,col;
#define valid0(x,y) x<0 || x>=row || y<0 || y>=col
#define valid1(nx,ny) nx>=1 && nx<=row && ny>=1 && ny<=col
ll fx[]={1,-1,0,0}; //4 side 2d
ll fy[]={0,0,1,-1};
//ll fx[]={+0,+0,+1,-1,-1,+1,-1,+1}; //8 side 2d
//ll fy[]={-1,+1,+0,+0,+1,+1,-1,-1};
//ll dx[] = {-2, -2, -1, -1, +1, +1, +2, +2};//Knight move
//ll dy[] = {-1, +1, -2, +2, -2, +2, -1, +1};


//Needed variables and arrays
//I am such a bad person to keep them outside from all functions and using them continuously :p such selflessness xD

ll a,b,c;

void read()
{
    slll(a,b,c);
}
void solve()
{
    ll x= max(a,max(b,c));
    ll sum=0;
    sum+=x-a;
    sum+=x-b;
    sum+=x-c;

    cout<<(sum%2==0? sum/2 : (sum/2)+2);

}
int main()
{
    read();
    solve();
}


Measured memory_bytes: 256