There are three friend living on the straight line Ox in Lineland. The first friend lives at the point x1, the second friend lives at the point x2, and the third friend lives at the point x3. They plan to celebrate the New Year together, so they need to meet at one point. What is the minimum total distance they have to travel in order to meet at some point and celebrate the New Year?It's guaranteed that the optimal answer is always integer.

The first line of the input contains three distinct integers x1, x2 and x3 (1 ≤ x1, x2, x3 ≤ 100) — the coordinates of the houses of the first, the second and the third friends respectively.

Print one integer — the minimum total distance the friends need to travel in order to meet together.

NoteIn the first sample, friends should meet at the point 4. Thus, the first friend has to travel the distance of 3 (from the point 7 to the point 4), the second friend also has to travel the distance of 3 (from the point 1 to the point 4), while the third friend should not go anywhere because he lives at the point 4.

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

int main()
{
	int a[3];
	for (int &x:a) cin >> x;
	sort (a, a+3);
	cout << a[2]-a[0];

	return 0;
}

#include<bits/stdc++.h>
#define In freopen("ahsan.txt","r",stdin);
#include<cstdio>
#include<cmath>
#define ll           long long int
#define pi           tacos(-1)
#define pii          pair<ll,ll >
#define bug(a)       cerr << #a << " : " << a << endl;
#define FastRead     ios_base::sync_with_stdio(false);cin.tie(NULL);
#define N 200020
using namespace std;
//ll   a[1010][1010],dp[N];
int main()
{
    // In;
    vector<pii>v;
    ll n,m,x,y,mis = 0,cris = 0,a[100000];
    cin>>a[0]>>a[1]>>a[2];
    sort(a,a+3);
    cout<<(a[1]-a[0])+(a[2]-a[1])<<endl;
///71 85 88 100 1 91

    return 0;
}

#include <iostream>
#include <cmath>
using namespace std;

int main(){
    int x1,x2,x3;
    cin>>x1>>x2>>x3;
    int d1=abs(x1-x2)+abs(x1-x3);
    int d2=abs(x2-x1)+abs(x2-x3);
    int d3=abs(x3-x2)+abs(x3-x1);
    cout<<min(d1,min(d2,d3))<<endl;
    return 0;
}

#include<iostream>
#include<bits/stdc++.h>
typedef int h;
typedef double d;
typedef long long ll;
ll a[10];
using namespace std;
int main(){
	cin>>a[0]>>a[1]>>a[2];
	sort(a,a+3);
	cout<<a[2]-a[0];

}

#include <bits/stdc++.h>

using namespace std;

int main(){
  int a, b, c;
  scanf("%d %d %d", &a, &b, &c);
  int ans = 100000, x;
  for(int i = 1; i <= 100; i++){
    x = (abs(a - i) + abs(b - i) + abs(c - i));
    if(ans >= x){
      ans = x;
    }
  }
  printf("%d", ans);
  return 0;
}

#include <iostream>

using namespace std;

int main()
 {
    int a1=0,a2=0,a3=0,x,y,z;
  cin>>x>>y>>z;
  a1=abs(x-y);
  a2=abs(x-z);
  a3=abs(y-z);
  if(a1>a2 && a1>a3)
    cout<<a1;
  else if(a2>a3)
    cout<<a2;
  else
    cout<<a3;
  return 0;
 }

#include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int arr[3];
	for (int i = 0; i < 3; i++) {cin >> arr[i];}
	sort(arr, arr + 3);
	cout << arr[2] - arr[0];
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
 int x[3],r,sum=150,d;
 scanf("%d%d%d",&x[1],&x[2],&x[3]);
 sort(x+1,x+4);
 for(r=x[1];r<=x[3];r++)
 {
  d=abs(x[1]-r)+abs(x[2]-r)+abs(x[3]-r);
  if(d<sum){sum=d;}
  d=0;
 }
 printf("%d",sum);
 return 0;
}

#include <bits/stdc++.h>
using namespace std;
int b, ma, mi,c, a1, a2, a3;
int main(){
cin>>a1>>a2>>a3;
ma=max(a1,max(a2,a3));
mi=min(a1,min(a2,a3));
a2=(a1+a2+a3)-ma-mi;
//b=(mi+(ma-mi-1)/2+1)
cout<<ma-mi;}

#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
int a[3],ans=9999;
int main()
{
	cin>>a[0]>>a[1]>>a[2];
	sort(a,a+3);
	for(int i=1;i<=a[2];i++)
		ans=min(ans,abs(i-a[0])+abs(i-a[1])+abs(i-a[2]));
	cout<<ans<<endl;
	return 0;
}

#include <iostream>
#include <sstream>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;

int main()
{

    int arr[3];
    cin>>arr[0]>>arr[1]>>arr[2];
   // arr[0]=min(arr[0],arr[1],arr[2]);
    //arr[2]=max(arr[0],arr[1],arr[2]);
    sort(arr,arr+3);
    cout<<(arr[2]-arr[1])+(arr[1]-arr[0])<<endl;

    return 0;
}

#include<iostream>
using namespace std;
int main()
{
    int a,b,c;
    cin>>a>>b>>c;
    cout<<max(a,max(b,c))-min(a,min(b,c))<<endl;
    return 0;
}

#include <iostream>
#include <algorithm>

using namespace std;

int main()
{

int ar[3];
cin>>ar[0]>>ar[1]>>ar[2];
sort(ar,ar+3);
int ans=ar[2]-ar[1]+ar[1]-ar[0];
cout<<ans;

}

#include<bits/stdc++.h>
using namespace std;
int main() {
    int arr[3];
    for (int i = 0; i < 3; i++)
    cin >> arr[i];
    for (int i = 1; i < 3; i++)
    {
        int tmp = arr[i];
        if (arr[i] < arr[i-1])
        {
            arr[i] = arr[i-1];
            arr[i-1]=tmp;
            i=0;
        }
    }
    cout << arr[2]-arr[1]+arr[1]-arr[0];
}

#include <iostream>
#include <fstream>
#include <string>
#include <vector>
using namespace std;

int main(){
	int a,b,c;
	cin >> a >> b >> c;
	if(a < b  && b < c) cout << c-b + b-a << endl;
	if(c < b && b < a) cout << a-b + b-c << endl;
	if(a < c && c < b) cout << c-a + b-c << endl;
	if(b < c && c < a) cout << c-b + a-c << endl;
	if(b < a && a < c) cout << a-b + c-a << endl;
	if(c < a && a < b) cout << a-c + b-a << endl;

	//system("pause");
	return 0;
}

#include <bits/stdc++.h>

using namespace std;
int sum (int a,int b,int c)
{
    int s[3]={a,b,c};
    int Max,Min,v;
    Max=s[0];
    Min=s[0];
    for(int i=0;i<=2;i++)
    {
        if(s[i]>=Max)
        {
            Max=s[i];
        }
        if(s[i]<=Min)
        {
            Min=s[i];
        }
    }
    for(int i=0;i<=2;i++)
    {
        if(Max>s[i])
        {
            if(Min<s[i])
            {
                v=s[i];
            }
        }
    }
    return v;
}
int main()
{
    int a,b,c,d,n=0,x;
    cin >> a >> b>> c;
    int s[3]={a,b,c};
    x=sum(a,b,c);
    for(int i=0;i<=2;i++)
    {
        if(s[i]>=x)
        {
            n=n+(s[i]-x);
        }
        else
        {
            n=n+(x-s[i]);
        }
    }
    cout << n << endl;
    return 0;
}

#include <bits/stdc++.h>

using namespace std;
typedef long long INT;

int main (){

	int a, b, c;
	cin >> a >> b >> c;

	int ans=0x3f3f3f3f;
	for(int i=1; i<=100; i++){
		ans=min(ans, abs(i-a)+abs(i-b)+abs(i-c));
	}

	cout << ans << endl;

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int x[3],i;
    for(i=0;i<3;i++) scanf("%d",&x[i]);
    sort(x,x+3);
    printf("%d\n",x[2]-x[0]);
}

#include <iostream>
#include <string>
#include <cmath>
using namespace std;
int main()
{
    int x1,x2,x3;
    cin>>x1>>x2>>x3;
    int a1=abs(x1-x1)+abs(x1-x2)+abs(x1-x3);
    int a2=abs(x2-x1)+abs(x2-x2)+abs(x2-x3);
    int a3=abs(x3-x1)+abs(x3-x2)+abs(x3-x3);
    int a4;
    a4=min(a1,a2);
    a4=min(a4,a3);
    cout<<a4<<endl;
    return 0;

}

#include <iostream>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <algorithm>
#include <string>
#include <list>

using namespace std;

#define loop(i,a,b) for(int i=a;i<b;++i)
typedef long long ll;
typedef string str;

int main ()
{
	ios::sync_with_stdio(0);
	cin.tie(0);

	int x1,x2,x3;
	cin >> x1 >> x2 >> x3;

	//~ int avr = (x1 + x2 + x3)/3;
	//~ int mid = min(x1,max(x2,x3));
	//~ cout << mid << " ";

	//~ cout << abs(mid - x1) + abs(mid - x2) + abs(mid - x3);

	cout << max(x1,max(x2,x3)) - min(x1,min(x2,x3));

	return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int x1, x2, x3;
    cin >> x1 >> x2 >> x3;
    if (x1<=x2)
        swap (x1,x2);
    if (x1<=x3)
        swap (x1,x3);
    if (x2<=x3)
        swap (x2,x3);
    cout << x1-x3;
}

#include<bits/stdc++.h>

using namespace std;
typedef long long int ll;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
#define all(x) (x).begin(), (x).end()
#define endl "\n"
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const ll mod = 1e9 + 7;
const ll inf = 2e9 + 5;
double PI = 3.14159265358979323846;

void solve() {

    vi a(3);
    cin >> a[0] >> a[1] >> a[2];
    sort(all(a));
    cout << (a[1]-a[0])+(a[2]-a[1]);
}

int32_t main()
{

    IOS

    //int T; cin >> T; while(T--)
    solve();
    return 0;

}

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

int main()
{
    int a[3],i;
    for(i=0;i<3;i++)
     cin>>a[i];

     sort(a,a+3);
     cout<<a[2]-a[0]<<endl;

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,x,xx,xxx;
	cin >> x >> xx >> xxx;
	cout << max(x,max(xx,xxx)) - min(x,min(xx,xxx)) << endl;
}

#include<iostream>
#include<algorithm>

using namespace std;

int main()
{

    int x[5],i,a=0,c;

    for(i=0; i<3; i++)
    {
        cin>>x[i];
    }

    sort(x,x+3);

    a = x[2] - x[0];  //short-cut finding without loop-search

    cout<<a<<endl;

    return 0;
}

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<cstdlib>
using namespace std;
int a,b,c,minz=2100000000;
int main(){
	cin>>a>>b>>c;
	if(a>b)swap(a,b);
	if(a>c)swap(a,c);
	if(b>c)swap(b,c);
	for(int i=a;i<=c;i++)
		minz=min(minz,abs(a-i)+abs(b-i)+abs(c-i));
	cout<<minz<<endl;
}

#include<bits/stdc++.h>
using namespace std;
long long first,second,sum;
int main()
{
    vector<int>vec;
    for(long long  i=0;i<3;i++)
    {
        long long n;cin>>n;
        vec.push_back(n);
    }
    sort(vec.begin(),vec.end());
    for(long long  i=0;i<3;i++)
    {

        first=vec[1]-vec[0];
        second=vec[2]-vec[1];
        sum=first+second;
    }
    cout<<sum<<endl;
    return 0;
}

#include <iostream>
#include <cmath>
using namespace std;
int mini (int x,int y,int z)
{
  int n1,n2,n3;

n1=abs(x-y)+abs(x-x)+abs(x-z);
n2=abs(y-y)+abs(y-x)+abs(y-z);
n3=abs(z-y)+abs(z-x)+abs(z-z);
    int miin=min(n1,n2);
    return min(miin,n3);
}
int  main()
{
    int x,y,z;
    cin >> x >> y >> z;
    cout << mini(x,y,z)<<endl;

}

#include <bits/stdc++.h>
using namespace std ;
int main()
{
    long long int Min , Max ;
    long long int x1 , x2 ,x3 ;
    cin >> x1 >> x2 >> x3 ;

    if  ( x1 > max (x2 ,x3) )
    {
        Max = x1 ;
        cout<< Max - min( x2 ,x3 ) << endl ;

    }
    else if ( x2 > max(x1 ,x3))
    {
        Max = x2 ;
        cout<< Max - min( x1 , x3 ) << endl ;

    }
    else if ( x3 > max (x2 , x1) )
    {
        Max = x3 ;
        cout << Max - min ( x2 , x1 ) <<endl;
    }
    return 0;
}

 #include <bits/stdc++.h>
using namespace std;
int main()
{
    int x,y,z;
    cin>>x>>y>>z;
    int ans=INT_MAX;
    ans=min(ans,abs(y-x)+abs(z-x));
    ans=min(ans,abs(x-y)+abs(y-z));
    ans=min(ans,abs(x-z)+abs(y-z));
    cout<<ans<<endl;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a[3],d,n=0;
    for(int i=0;i<3;++i)
    cin>>a[i];
    sort(a,a+3);
    d=(a[0]+a[2])/2;

    for(int i=0;i<3;++i)
    {
        n+=abs(d-a[i]);
    }
    cout<<min(n,a[2]-a[0]);

}

#include <iostream>
#include <cmath>
using namespace std;
int minn(int,int,int);
int main()
{
  int x1,x2,x3;
  cin>>x1>>x2>>x3;

  int d1=abs(x2-x1)+abs(x3-x1);
    int d2=abs(x1-x2)+abs(x3-x2);
  int d3=abs(x3-x1)+abs(x3-x2);

cout<<minn(d1,d2,d3);

}
int minn(int a,int b , int c)

{
  int m=a;
  if (b<m) m=b;
  if (c<m)m=c;
  return m;
}

#include<bits/stdc++.h>
using namespace std;
long long a,b,c,i,j,d;
int main()
{
 cin>>a>>b>>c;
 i=min(c,min(a,b));
 j=max(c,max(a,b));
 cout<<j-i;
}

#include<iostream>

using namespace std ;

int main()
{
	int a(0),b(0),c(0);
	cin>>a>>b>>c ;
	int min(a),max(a),mid(a);
	if (b<min)
	{
		min=b;
	}
	if (c<min)
	{
		min=c;
	}

	if (b>max)
	{
		max=b;
	}
	if (c>max)
	{
		max=c;
	}
	if (((min==a)&&(max==b))||(min==b)&&(max==a))
	{
		mid=c;
	}

	if (((min==c)&&(max==a))||(min==a)&&(max==c))
	{
		mid=b;
	}

	int s(0);
	s=(max-mid)+(mid-min);
	cout<<s;

	return 0 ;
}

#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<sstream>
#include<iomanip>
#include <utility>
using namespace std;
pair<int,int> pr[100000];

int main(){

	ios_base::sync_with_stdio(0);
	cin.tie(NULL), cout.tie(NULL);
	int x,y,z,mn;
	cin>>x>>y>>z;
	mn=(abs(x-y)+abs(x-z));
	if((abs(y-z)+abs(y-x))<mn)
		mn=abs(y-z)+abs(y-x);

    if((abs(z-x)+abs(z-y))<mn)
		mn=(abs(z-x)+abs(z-y));
	cout<<mn<<endl;
	return 0;

}

#include <bits/stdc++.h>
using namespace std;
int main (){
int a,b,c;
cin>>a>>b>>c;
int q,w,e,r,t,y;
q=max (a,b);
w=min (a,b);
e=max (b,c);
r=min (b,c);
t=max (a,c);
y=min (a,c);
if(a<b && a<c && b<c){ //c>all a<all
    cout<<c-a;
}
if(a>b && b>c && a>c){ //a>all c<all
    cout<<a-c;
}
if(a<b && a<c && b>c){ //b>all a<all
    cout<<b-a;
}
if(a>b && a>c && b<c){ //a>all b<all
    cout<<a-b;
}
if(a>c && a<b && b>c){ //b>all c<all
    cout<<b-c;
}
if(a<c && a>b && c>b){ //c>all b<all
    cout<<c-b;
}
return 0;
}
/*1 2 3
1 3 2
2 1 3
2 3 1
3 2 1
3 1 2
*/

#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <stdlib.h>
#include <bitset>
#include <malloc.h>
#include <hash_map>

using namespace std;

#define rep(i,a,b) for (int i=(a),_ed=(b);i<=_ed;i++)
#define per(i,a,b) for (int i=(b),_ed=(a);i>=_ed;i--)
#define pb push_back
#define mp make_pair
const int inf_int = 2e9;
const long long inf_ll = 2e18;
#define inf_add 0x3f3f3f3f
#define mod 1000000007
#define LL long long
#define ULL unsigned long long
#define MS0(X) memset((X), 0, sizeof((X)))
#define SelfType int
SelfType Gcd(SelfType p,SelfType q){return q==0?p:Gcd(q,p%q);}
SelfType Pow(SelfType p,SelfType q){SelfType ans=1;while(q){if(q&1)ans=ans*p;p=p*p;q>>=1;}return ans;}
#define Sd(X) int (X); scanf("%d", &X)
#define Sdd(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define Sddd(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define reunique(v) v.resize(std::unique(v.begin(), v.end()) - v.begin())
#define all(a) a.begin(), a.end()
#define   mem(x,v)      memset(x,v,sizeof(x))
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef vector<int> vi;
typedef vector<long long> vll;
inline int read(){
    int ra,fh;char rx;
    rx=getchar(),ra=0,fh=1;
    while((rx<'0'||rx>'9')&&rx!='-')
        rx=getchar();
    if(rx=='-')
        fh=-1,rx=getchar();
    while(rx>='0'&&rx<='9')
        ra*=10,ra+=rx-48,rx=getchar();
    return ra*fh;
}
bool pii_ordering(const std::pair<int,int> a,const std::pair<int,int> b)
{ return a.second < b.second; }
bool int_ordering(const int &a,const int &b)
{ return a < b; }

//#pragma comment(linker, "/STACK:102400000,102400000")
//*************************************************************************************************//
#define Nmax 2505
int x1,x2,x3;
vector<int>  XX;
int re;
void Input(){
    int i,j;
    x1=read();
    x2=read();
    x3=read();
    XX.pb(x1);
    XX.pb(x2);
    XX.pb(x3);
}

void Compute(){

    sort(XX.begin(),XX.end(), int_ordering);
    re=XX[2]-XX[0];
}
void Print(){
    int i;
    printf("%d\n",re);

}
int main(){
    Input();
    Compute();
    Print();
    return 0;
}

#include <iostream>
#include <cmath>
using namespace std;
int minn(int ,int ,int);
int main(){
int x1,x2,x3;
cin>>x1>>x2>>x3;

int d1=abs(x1-x2)+abs(x1-x3);
int d2=abs(x2-x1)+abs(x2-x3);
int d3=abs(x3-x1)+abs(x3-x2);

 cout<<minn(d1,d2,d3);

    return 0;
}
int minn(int a,int b,int c){
   int min=a;
    if(b<min) min=b;
    if(c<min) min=c;
    return min;
}

#include <iostream>
#include <cmath>
using  namespace std;
int main()
{
	int n,m,k,max,min,joy,min1;
	cin>>n>>m>>k;
	max=n;
	min=n;

	if(max<m)
	max=m;
	else
	min=max;

	if(max<k)
	max=k;
	else
	min=k;
	min1=abs(min-n)+abs(min-m)+abs(min-k);
	for(int i=min+1;i<=max;i++)
	{
		joy=abs(i-n)+abs(i-m)+abs(i-k);
		if(min1>joy)
		min1=joy;
	}
	cout<<min1;
}

// luogu-judger-enable-o2
#include<algorithm>
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<cmath>
#include<ctime>
#include<stack>
#include<queue>
using namespace std;
int main()
{
	int a,b,c;
	cin>>a>>b>>c;
	int d=max(a,max(b,c))-min(a,min(b,c));
	printf("%d",d);
	return 0;
}

#include <iostream>
using namespace std;
int xw (int ,int ,int) ;
int main() {
  int x1,x2,x3,b,c,v;
  cin>>x1>>x2>>x3;
  b=abs(x1-x2) + abs(x1-x3);
  c=abs(x2-x1) + abs(x2-x3);
  v=abs(x3-x1) + abs(x3-x2);
  cout<<xw(b,c,v);

  return 0;

}
int xw (int a1,int a2,int a3) {
if(a1<a2 &&a1<a3) return a1;
if(a2<a1 &&a2<a3) return a2;
if(a3<a1 &&a3<a2) return a3;
}

#include<iostream>

using namespace std;

int main()
{
	int x1, x2, x3;
	cin >> x1 >> x2 >> x3;
	cout << max(max(x1 ,x2), x3) - min(min(x1, x2), x3);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a[4];
	cin>>a[1]>>a[2]>>a[3];
	sort(a+1,a+4);
	cout<<a[3]-a[1]<<endl;
	return 0;
}

#include <iostream>
#include <algorithm>
#include <cstdlib>
using namespace std;

  int a[4];

int main()
{
	cin >> a[1] >> a[2] >> a[3];
	sort (a+1, a+4);

	int point = (a[1] + a[3]) / 2;
	cout << (point - a[1]) + (a[3] - point);

 return 0;
}

#include <iostream>
using namespace std;

int minimum (int a, int c)
{
    int v;
    if (a<c)
    v=a;
    else
    v=c;
    return v;
}

int main ()
{

   int x1,x2,x3;
   cin>>x1>>x2>>x3;
   int b1,b2,b3;
   b1=abs(x1-x2)+abs(x1-x3);
   b2=abs(x2-x1)+abs(x2-x3);
   b3=abs(x3-x1)+abs(x3-x2);
   int v=minimum(b1,b2);
   cout<<minimum(v,b3);

return 0;
}

#include <iostream>
using namespace std;

int main()
{
	long x[3];
	long min = 0;
	for(int i = 0; i<3;++i)
	cin >> x[i];
	for (int i = 0; i < 3 - 1; i++)
	{
		bool swapped = false;
      for (int j = 0; j < 3 - i - 1; j++)
	  {
		  if (x[j] > x[j + 1])
		  {
			  int b = x[j];
		     x[j] = x[j + 1];
			 x[j + 1] = b;
				   swapped = true;

			}
		}

	if (!swapped)
		break;
	}

	min = x[1] - x[0] + x[2]- x[1];

	cout << min << endl;

	return 0;
}

#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
    int a[3];
    cin>>a[0]>>a[1]>>a[2];
    sort(a,a+3);
    cout<<a[1]-a[0]+a[2]-a[1];
}

#include<iostream>
#include<cmath>
using namespace std;
int main()
{ int x1,x2,x3;
cin>>x1>>x2>>x3;
int a=(x1-x1)+abs(x1-x2)+abs(x1-x3);
int b=(x2-x2)+abs(x2-x1)+abs(x2-x3);
int c=(x3-x3)+abs(x3-x2)+abs(x3-x1);
if(a<b && a<c)
cout<<a<<endl;
else if(b<a && b<c)
    cout<<b<<endl;
else cout<<c<<endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b,c;
	scanf("%d%d%d",&a,&b,&c);
	for(int i=0;i<10000;i++){
		//do nothing
		for(int j=0;j<1000;j++){
		    a=a+a;
		    b=b+b;
		    c=c+c;
		    a/=2;
		    b/=2;
		    c/=2;
			//hehe
		}
	}
	printf("%d\n",max(a,max(b,c))-min(a,min(b,c)));
}

#include <iostream>
#include <cmath>
#include <cstdlib>
using namespace std ;
int main () {
    int a , b , c ,suma , sumb , sumc ;
    cin >> a >> b >> c  ;
    suma = abs(a-b)+ abs(a-c) ;
    sumb = abs(b-a)+abs(b-c) ;
    sumc = abs(c-a)+abs(c-b) ;
    cout << min(suma , min(sumb,sumc)) << endl ;

    return 0 ;

}

#include<iostream>
#define ll long long
#include<algorithm>
using namespace std;
int main()
{
	int a[3];
	cin>>a[0]>>a[1]>>a[2];
	sort(a,a+3);
	cout<<a[2]-a[0];
}

#include <iostream>

#include <algorithm>

#include <cmath>

using namespace std;

int main() {

    int a, b, c, suma, sumb, sumc;

    cin >> a >> b >> c;

    suma = abs(a-b) + abs(a-c);

    sumb = abs(b-a) + abs(b-c);

    sumc = abs(c-a) + abs(c-b);

    cout << min(suma, min(sumb, sumc)) << endl;

    return 0;

}

#include <iostream>
#include <cmath>
using namespace std;

int main (){
    int x1,x2,x3;
    cin >>x1 >> x2>> x3;
    int d1 = abs (x2-x1) + abs (x3-x1);
    int d2 = abs (x1-x2) + abs (x3-x2);
    int d3 = abs (x1-x3) + abs (x2-x3);
 cout <<min (d1,min(d2,d3));
 return 0;
}

#include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int a, b, c;
	cin >> a >> b >> c;
	int x = abs(a - a) + abs(a - b) + abs(a - c);
	int y = abs(b - a) + abs(b - b) + abs(b - c);
	int z = abs(c - a) + abs(c - b) + abs(c - c);
	cout << min(min(x, y), z);
	}

#include <iostream>

using namespace std;

int main()
{
    int x,y,z,m=0;
    cin>>x>>y>>z;
    if(1<=x,y,z<=100)
    {
        if(x>=y&&y>=z)
        {
            m+=(x-y)+(y-z);
            cout<<m;

        }
        else if(y>=x&&x>=z)
        {
            m+=(y-x)+(x-z);
            cout<<m;

        }
        else if(z>=y&&y>=x)
        {
            m+=(z-y)+(y-x);
            cout<<m;
        }
            else if(x>=z&&z>=y)
            {
                m+=(x-z)+(z-y);
                cout<<m;
            }
            else if(y>=z&&z>=x)
            {
                m+=(y-z)+(z-x);
                cout<<m;
            }
            else if(z>=x&&x>=y)
            {
                m+=(z-x)+(x-y);
                cout<<m;
            }
        }

    return 0;
}

#include <iostream>
#include <string>
#include <cmath>
using namespace std;
int main()
{
    int n1,n2,n3;
    cin>>n1>>n2>>n3;
    int n4=abs(n1-n1)+abs(n1-n2)+abs(n1-n3);
    int n5=abs(n2-n1)+abs(n2-n2)+abs(n2-n3);
    int n6=abs(n3-n1)+abs(n3-n2)+abs(n3-n3);
    /*int n7;
    n7=min(n4,n5);
    n7=min(n7,n6);
    cout<<n7<<endl;
    */
    if(n4<=n5&& n4<=n6)  cout<<n4<<endl;
    else if(n5<=n4 && n5<=n6 )  cout<<n5<<endl;
    else if(n6<=n4 && n6<=n5)  cout<<n6<<endl;

}

#include<iostream>
#include<cmath>
using namespace std;
int main ()
{
    int x1,x2,x3;
    cin>>x1>>x2>>x3;
    int a=(x1-x1)+abs(x1-x2)+abs(x1-x3);
    int b =(x2-x2)+abs(x2-x1)+abs(x2-x3);
    int c= (x3-x3)+abs(x3-x1)+abs(x3-x2);
    cout<<min(min(a,b),c);
    return 0;}

#include <iostream>
using namespace std;
int min1(int a,int b,int c)
{if(a<b && a<c) return a;
else if(b<a && b<c)  return b;
return c;
}
	int min2(int a,int b)
	{if (a<b) return a; return b;}
int main()
{int x1,x2,x3,d1,d2,d3;
cin>>x1>>x2>>x3;
d1 = abs(x2-x1) + abs(x3-x1);
	d2 = abs(x2-x1) +abs(x3-x2);
	d3 = abs(x3-x1) +abs(x3-x2);
	//cout<<min1(d1,d2,d3)<<endl;
	cout<<min(d1, min(d2,d3))<<endl;

return 0;
}

 #include <iostream>
#include <string>
using namespace std;
int minn(int ,int ,int );
int main()
{
 int x1,x2,x3;
 cin>>x1>>x2>>x3;
 int d1=abs(x1-x2)+abs(x1-x3);
 int d2=abs(x2-x1)+abs(x2-x3);
 int d3=abs(x3-x1)+abs(x3-x2);
 cout<<minn(d1,d2,d3)<<endl;

return 0;
}
 int minn(int a ,int b ,int c ) {
 int m=a;
 if(b<m)
 m=b;
 if(c<m)
 m=c;
 return m;}

// Firstc++pro.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include<string>
#include <iomanip>
#include <map>
#include <vector>

using namespace std;
//int test(int area) {
//	int muil = area;
//	if (muil % 2 == 0)
//	{
//		return muil / 2;
//	}
//
//	return (muil - 1) / 2;
//
//}

int main()
{
	//first problem
	//int num ;
	//cin >> num;
	//if (num % 2 == 0&&num!=2)
	//{
	//	cout<<"YES";
	//}
	//else
	//{
	//	cout<<"NO";
	//}
	//return 0;

	//second problem
	/*int a, b, c;
	cin >> a >> b >> c;
	int first = a + b * c;
	int second = a * (b + c);
	int third = a * b * c;
	int fourth = (a + b) * c;
	int five = a + b + c;

 if (first>=second&&first>=third&&first>=fourth&&first>=five)
	{
		cout << first;
	}
 else if(five >= second && five >= third && five >= fourth&&five>=first){
	 cout << five;
 }
	else if (third >= second && third >= first && third >= fourth && third >= five)
	{
		cout<<third;
	}
	else if (second >= first && second >= third && second >= fourth && second >= five)
	{
		cout << second;
	}
	else {
		cout << fourth;
	}*/
	/*int num1, num2;
	cin >> num1 >> num2;
	cout << test(num1*num2);*/
	int a, b, c;
	cin >> a >> b >> c;
	int mod;
	if ((a>=b&&b>=c)||( c >= b && b >= a))
	{
		mod = b;
	}
	else if ((b>=a&&a>=c)|| (c >= a && a >= b)) {
		mod = a;
	}
	else {
		mod = c;
	}
	int totaldistance = 0;

	totaldistance += mod-a<0?a-mod:mod-a;
	totaldistance += mod - b < 0 ? b - mod : mod - b;
	totaldistance += mod - c < 0 ? c - mod : mod - c;
	cout << totaldistance;
}

/*
[by.YXH_XianYu]
2018.05.31
Introduction:
*/
#include<algorithm>
#include<cstdlib>
#include<cstdio>

int a[3];

int main(){
	//freopen("YXH_XianYu.in","r",stdin);
	//freopen("YXH_XianYu.out","w",stdout);

	scanf("%d%d%d",&a[0],&a[1],&a[2]);
	std::sort(a,a+3);
	printf("%d\n",a[2]-a[0]);

	//system("pause");
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int ara[3];
    int i;
    for (i=0;i<3;i++)
    {
        scanf("%d",&ara[i]);
    }
    int j,temp;
    for (i=0;i<3;i++)
    {
        for (j=i+1;j<3;j++) {
            if (ara[i]>ara[j]) {
                temp=ara[i];
                ara[i]=ara[j];
                ara[j]=temp;
            }
        }
    }
    int total=ara[1]-ara[0]+ara[2]-ara[1];
    printf("%d",total);
}

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

int max(int a,int b,int c){
	if(a>=b&&a>=c)return a;
	if(b>=a&&b>=c)return b;
	if(c>=a&&c>=b)return c;
}
int min(int a,int b,int c){
	if(a<=b&&a<=c)return a;
	if(b<=a&&b<=c)return b;
	if(c<=a&&c<=b)return c;
}
int main(){
	int a,b,c;
	cin>>a>>b>>c;
	cout<<max(a,b,c)-min(a,b,c)<<endl;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
int b, ma, mi,c, a1, a2, a3;
int main(){
cin>>a1>>a2>>a3;
ma=max(a1,max(a2,a3));
mi=min(a1,min(a2,a3));
a2=(a1+a2+a3)-ma-mi;
//b=(mi+(ma-mi-1)/2+1)
cout<<ma-mi+1-1;}

#include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int x1, x2, x3;
	cin >> x1 >> x2 >> x3;
	int a, b, c;
	a = x1 - x1 + max(x2, x1) - min(x2, x1) + max(x3, x1) - min(x3, x1);
	b = max(x2, x1) - min(x2, x1) + x2 - x2 + max(x2, x3) - min(x2, x3);
	c = max(x3, x1) - min(x3, x1) + max(x3, x2) - min(x2, x3) + x3 - x3;

	if (a > b ||a==b)
		cout << min(b, c) << endl;
	else if (a < b||a==b)
		cout << min(a, c) << endl;
}

#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <tuple>

using namespace std;

using type = unsigned long long;
using line = vector <type>;

int main() {
	// ...
	ios::sync_with_stdio(false);
	//freopen("input.txt", "rt", stdin);
	vector <int> d(3);
	cin >> d[0] >> d[1] >> d[2];

	sort(d.begin(), d.end());

	cout << d.back() - d.front();

	return 0;
}

#include <iostream>
#include<cmath>
using namespace std;
int minval(int a,int b,int c){

  return min(min(a,b),c);
}

void print(int a)
{
  cout<<a<<endl;

}
int main() {
  int x1,x2,x3,d1,d2,d3;
  cin>>x1>>x2>>x3;
  d1=abs(x1-x2)+ abs(x3-x1);
  d2=abs(x1-x2)+ abs(x3-x2);
  d3=abs(x1-x3)+ abs(x3-x2);

 print( minval(d1,d2,d3) );
}

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int next_round(int ,int );
int bit(int );
int three_friends(vector<int>);
int team(int n)
{
    int counter=0;
	int a,b,c ;
	for(int i=0;i<n;i++)
	{
		cin>>a>>b>>c;
		if((a+b+c)>=2)
			counter++;

	}
	return counter;
}

int main()
{
	/*int n;
	cin>>n;
	cout<<team(n);*/

	/*int n,k;
	cin>>n>>k;
    cout<<next_round(n,k);
    */
    /*int n;
    cin>>n;
    cout<<bit(n);*/

    vector<int> a;
    int x;
    for(int i=0;i<3;i++)
    {
        cin>>x;
        a.push_back(x);
    }
    cout<<three_friends(a);
}

int next_round(int n,int k)
{
    int a[51];
    int counter=0,counter1=0;
    for(int i=0;i<n;i++){
        cin>>a[i];
        if(a[i]>0)
            counter1++;
    }
   // if(counter1!=0) {
    for(int i=0;i<n ;i++)
    {
        if(a[i]>=a[k-1] && a[i]>0 )
            counter++;
    }
    return counter;

    //else
      //  return 0;

}

int bit(int n)
{
    string x;
    int counter=0;
    for(int i=0;i<n;i++)
    {
        cin>>x;
        if(x[1]=='-')
            counter--;
        else
            counter++;
    }
    return counter;
}

int three_friends(vector<int> a)
{
    sort(a.begin(),a.end());
    return (a[2]-a[1]) + (a[1]-a[0]);
}

#include <iostream>
#include <string>
#include <cmath>

using namespace std;

int main(){
int n1,n2,n3;
cin>>n1>>n2>>n3;
cout<<max(n1, max(n2,n3)) - min(n1 ,min (n2,n3));

return 0;
}

#include <iostream>
#include <string>
#include <locale>
#include <algorithm>
#include <cctype>
#include <math.h>
#include <cstring>
#include <stdio.h>
#include <vector>
#include <bits/stdc++.h>
#include <sstream>

using namespace std;

int main(){
    int a, b, c, d = 0,e, f,g;
    cin >> a >> b >> c;

    d = (a+b+c)/3;
    f = abs(a-d) + abs(b-d) + abs(c-d);
    e = max (a, max(b,c));
    g = min (a, min(b,c));

    cout << min(f, e-g);

}

/*

    for (int i = 0; i<n; i++){

    }

*/

#include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;
int main(){
int a[3];
int b=0,c=0;
for(int i=0;i<3;i++){
    cin>>a[i];
}
sort(a,a+3);
cout<<((a[1]-a[0])+(a[2]-a[1]));
return 0;
}

#include <iostream>
#include <math.h>

using namespace std;

void sort(int x[]);
void subtract(int x[], int size);
int sum(int x[], int size);

void main()
{
	int x[3];
	cin >> x[0];
	cin >> x[1];
	cin >> x[2];
	sort(x);
	subtract(x, 3);
	int s = sum(x, 3);
	cout << s << endl;
}

void subtract(int x[], int size)
{
	x[0] = abs(x[0] - x[1]);
	x[2] = abs(x[2] - x[1]);
	x[1] = 0;
}

int sum(int x[], int size)
{
	int s = 0;
	for (int i = 0; i < size; i++)
	{
		s += x[i];
	}
	return s;
}
void sort(int x[3])
{
	int swap;
	for (int i = 0; i < 3; i++)
	{
		for (int j = 0; j < 2; j++)
		{
			if (x[j] < x[j + 1])
			{
				swap = x[j];
				x[j] = x[j + 1];
				x[j + 1] = swap;
			}
		}
	}
}

#include <iostream>
#include <cmath>
using namespace std;

int fun(int a , int b , int c)
{
  int q = abs(a-b)+abs(c-b);

  int r = abs(b-c) + abs(a-c);

  int t = abs(b-a)+abs(c-a);

  return min(min(q,r) , t);

}

int main() {

  int a  , b ,c;

  cin>>a>>b>>c;

  cout<<fun(a , b , c)<<endl;

}

// Example program
#include <iostream>
#include <cmath>
#include <string>
using namespace std;
int minn(int , int  ,int );
int main()
{

  int a  ,b, c;
  cin>>a>>b>>c;
  int n1=abs(a-b)+abs(a-c);
  int n2=abs(b-a)+abs(b-c);
  int n3=abs(c-a)+abs(c-b);
  cout<<minn(n1  ,n2 , n3);

}

int minn(int n1, int n2 , int n3)
{
  return min(n1,min(n2,n3));

}

#include <iostream>
#include <algorithm>
using namespace std;

int computeDistances(int meetPoint, int one, int two, int three);

int main()
{
    int x1, x2, x3;
    cin >> x1 >> x2 >> x3;
    int maxX = max(x1, max(x2, x3));
    int minX = min(x1, min(x2, x3));
    int best = 99999;

    for (int x = minX; x <= maxX; x++)
    {
        best = min(best, computeDistances(x, x1, x2, x3));
    }

    cout << best;

}

int computeDistances(int meetingSpot, int one, int two, int three)
{
    return abs(meetingSpot - one) + abs(meetingSpot - two) + abs(meetingSpot - three);
}

#include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int a[3];
	cin>>a[0]>>a[1]>>a[2];
	sort(a,a+3);
	cout<<a[2]-a[0]<<endl;
}

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

int main()
{
    int a[3];
    for(int i=0;i<3;i++)
    {
        cin>>a[i];
    }
    for(int j=0;j<3;j++)
    {
    for(int i=0;i<3;i++)
    {
        if(a[j]>a[i])
        {
            int temp;
            temp=a[i];
            a[i]=a[j];
            a[j]=temp;
        }
    }
    }
   int y= abs(a[1]-a[0]);
    int x=(abs(a[1]-a[2]));

    cout<<x+y;
 return 0;
}

// Example program
#include <iostream>
using namespace std;
#include<cmath>
int main()
{int x,y,z;
cin>>x>>y>>z;
int d1=abs(x-y)+abs(x-z);
int d2=abs(x-y)+abs(y-z);
int d3=abs(z-y)+abs(x-z);
if((d1<d2)&&(d1<d3))           cout<<d1;
else if ((d2<d1)&&(d2<d3))         cout<<d2;
else               cout<<d3;          return 0;}

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

int main()
{
    long long x1,x2,x3;
    long long ans = 1e9;
    cin>>x1>>x2>>x3;
    for(int i=-10000;i<=10000;i++)
    {
        ans = min(ans,abs(x1-i)+abs(x2-i)+abs(x3-i));
    }
    cout<<ans<<endl;
}

#include <cstdlib>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
    /*freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);*/
    int n , k , i , x,maxx,minn,d;
    cin >> n >> k >> i;
    minn=min(n,k);
    minn=min(minn,i);
    maxx=max(n,k);
    maxx=max(maxx,i);
    x=(maxx+minn)/2;
    d = abs(n-x)+abs(k-x)+abs(i-x);
    cout << min(maxx-minn,d);
  // system("PAUSE");
 }

#include<iostream>
#include<cmath>
using namespace std;
int minn(int a,int b,int c)
{
 int m=a;
 if(b<m) m=b;
 if(c<m) m=c;
 return m;

}
int main()
{
  int x1,x2,x3;
  cin>>x1>>x2>>x3;
  int d1,d2,d3;
  d1=abs(x1-x2)+abs(x1-x3);
  d2=abs(x2-x1)+abs(x2-x3);
  d3=abs(x3-x1)+abs(x3-x2);
  cout<<minn(d1,d2,d3);

}

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

int main(void)
{
    int a[8], s = 0;
    for (int i = 1; i <= 3; i++) cin >> a[i];
    sort(a + 1, a + 4);
    cout << a[3] - a[2] + a[2] - a[1];
    return 0;
}

#include <iostream>
#include <cmath>
using namespace std;

int main(){
  int x, y, z;
  cin >> x >> y >> z;
  if(((abs(x - y) + abs(x - z)) <= (abs(y - x) + abs(y - z))) && ((abs(x - y) + abs(x - z)) <= (abs(z - x) + abs(z - y)))){
      cout << (abs(x - y) + abs(x - z));
  }
  else if(((abs(y - x) + abs(y - z)) <= (abs(x - y) + abs(x - z))) && ((abs(y - x) + abs(y - z)) <= (abs(z - x) + abs(z - y)))){
      cout << (abs(y - x) + abs(y - z));
  }
  else{
      cout << (abs(z - x) + abs(z - y));
  }
}

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

int main(){
	int x1,x2,x3;
	cin>>x1>>x2>>x3;
    int s1=abs(x1-x2);
    int s2=abs(x1-x3);
    int s3=abs(x2-x3);
    if(s1<s2&&s3<s2) cout<<s2<<endl;
    else if(s1<s3&&s2<s3) cout<<s3<<endl;
    else if(s2<s1&&s3<s1) cout<<s1<<endl;
    return 0;
}

#include <iostream>
#include <cmath>
#include <cstdlib>

using namespace std;

int main () {
    int x1 ,x2 ,x3 ,m1 ,m2 ,m3;
    cin>>x1>>x2>>x3;

    m1=abs(x1-x2) + abs(x1-x3);
    m2=abs(x1-x2) + abs(x2-x3);
    m3=abs(x1-x3) + abs(x3-x2);

    cout<< min(min(m1,m2),m3);
    return 0;
}

#include <iostream>
#include <cmath>
using namespace std;
int minn(int,int,int);
int main()
{
  int x1,x2,x3;
  cin>>x1>>x2>>x3;

  int d1=abs(x2-x1)+abs(x3-x1);
    int d2=abs(x1-x2)+abs(x3-x2);
  int d3=abs(x3-x1)+abs(x3-x2);

cout<<minn(d1,d2,d3);

}
int minn(int a,int b , int c)

{
  int m=a;
  if (b<m) m=b;
  if (c<m)m=c;
  return m;
}

#include <iostream>

using namespace std;

int main()
{
    int x,y,z;
    cin >> x >> y >> z ;
    if (x>y && x>z && y<z){
        cout << x-y <<endl;
    }
    else if (y>x && y>z && x<z){
            cout << y-x <<endl;

    }
    else if (x>y && x>z && z<y){
        cout << x-z <<endl;
    }
    else if (y>x && y>z && z<y){
        cout << y-z <<endl;
    }
    else if (z>x && z>y && x<y){
            cout << z-x <<endl;
    }
    else{
       // if (z>x && z>y && y<x){
            cout << z-y <<endl;
       // }
    }
    return 0;
}

#include <iostream>
#include <algorithm>
using namespace std;
int a[110];
int f(int x,int i){
	if(x>i) return x-i;
	else return i-x;
}
int main(){
	int x[3];
	cin>>x[0]>>x[1]>>x[2];
	sort(x,x+3);
	fill(a,a+110,2100000000);
	for(int i=x[0];i<=x[2];i++)
		a[i]=f(x[0],i)+f(x[1],i)+f(x[2],i);
	sort(a,a+110);
	cout<<a[0];
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
    int a,b,c,maxx,minn;
    scanf("%d%d%d",&a,&b,&c);
    maxx=max(a,max(b,c));
    minn=min(a,min(b,c));
    cout<<maxx-minn;
    return 0;
}

#include<iostream>
#include<cmath>
using namespace std;
 int min(int a, int b,int c)
 {
  if (a<=b&&a<=c)
  return a;
  else if(b<=a&&b<=c)
  return b;
  return c;
 }

int main()
{
int x1,x2,x3;
cin>>x1>>x2>>x3;
int d,r,s;
d=abs(x1-x1)+abs(x1-x2)+abs(x1-x3);

  r=abs(x2-x2)+abs(x2-x1)+abs(x2-x3);

  s= abs(x3-x3)+abs(x3-x2)+abs(x3-x1);

cout<<min(d,r,s);
return 0;

}

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <queue>
#include <stack>
#include <algorithm>

using namespace std;

int main()
{
    int x1, x2, x3;
    while (cin >> x1 >> x2 >> x3)
    {
        int a[4];
        memset(a, 0, sizeof(a));
        a[0] = x1;
        a[1] = x2;
        a[2] = x3;
        sort(a, a + 3);
        int sum = a[1] - a[0] + a[2] - a[1];
        cout << sum << endl;
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main(){
    int x,y,z,i,a[10000],sum=0;
    cin >> x >> y >> z;
    for(i=-1000;i<=1000;i++){
        a[sum]=abs(i-x)+abs(i-y)+abs(i-z);
        sum++;
    }
    sort(a,a+sum);
    cout << a[0];
    //cout << abs(x-(x+y+z)/3)+abs(y-(x+y+z)/3)+abs(z-(x+y+z)/3);
    return 0;
}

#include<stdio.h>

void swap(int *a, int *b)
{
	int temp = *a;
	*a = *b;
	*b = temp;
}

void sort(int arr[])
{
	int size = 3;
	for(int i=0; i<size-1; i++)
	{
		for(int j=0; j<size-1-i; j++)
		{
			if(arr[j]>arr[j+1]) swap(&arr[j], &arr[j+1]);
		}
	}
}

int main()
{
	int number[3];
	for(int k=0; k<3; k++)
	{
		scanf("%d", &number[k]); getchar();
	}
	sort(number);
//	int total = (number[1]-number[0])+(number[2]-number[1]);
	printf("%d\n",(number[1]-number[0])+(number[2]-number[1]));
	return 0;
}

#include<iostream>
        #include<algorithm>
        #include<vector>

        using namespace std;

        int main(){
            vector<int> v(3); cin>>v[0]>>v[1]>>v[2];
            sort(v.begin(),v.end());
            int min=301;
            for(int i=v[0];i<=v[2];i++){
                int s=abs(i-v[0])+abs(i-v[1])+abs(i-v[2]);
                if(s<min) min=s;
            }
            cout<<min;

            return 0;
        }

#include<iostream>
#include<algorithm>
#include<cmath>

using namespace std;
const int inf = 1e9;
const int mod = 1<<30;
const double eps = 1e-8;
const double pi = acos(-1.0);
typedef long long LL;

int main()
{
    int a[6], ans;
    scanf("%d%d%d", &a[0], &a[1], &a[2]);
    sort(a, a + 3);

    ans = (a[1] - a[0]) + (a[2] - a[1]);
    printf("%d\n", ans);
    return 0;
}

#include <iostream>
using namespace std;
void main ()
{
    int a,b,c,m,n;
    cin>>a>>b>>c;
    if (a>b && b>c) {
        m=a-b;
        n=b-c;
        cout<<m+n<<endl;
    }
    if (a>b && c>b){
        m=a-c;
        n=c-b;
        cout<<m+n<<endl;
    }
    if (b>a && c>b) {
        m=c-b;
        n=b-a;
        cout<<m+n;
    }

}

#include <iostream>
#include <math.h>

using namespace std;

void main() {
	int a=0, n[3], sum = 0;
	for (int i = 0; i < 3; ++i) {
		cin >> n[i];
		sum += n[i];
	}
	sum /= 3;
	for (int i = 0; i < 3; ++i) {
		a += abs(sum - n[i]);
	}
	cout << a;
}

#include <bits/stdc++.h>

using namespace std;

main () {
	int a[5];
	cin>>a[0]>>a[1]>>a[2];
	int mx=*max_element(a,a+3);
	int mn=*min_element(a,a+3);
	int mid=(mx+mn)/2;
	int d=0;
	for (int i=0; i<3; i++)  d+=abs(a[i]-mid);
	cout<<d<<endl;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c;
	cin>>a>>b>>c;
	int d=(a+b+c)/3;
	cout<<abs(a-d)+abs(b-d)+abs(c-d)<<endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
	int i,min,max,a[i];
	for(i=0;i<3;i++){
		cin>>a[i];
	}
	sort(a,a+2);
	int k=(a[0]+a[2])/2;
	int sum=0;
	for(i=0;i<3;i++){
		sum=sum+abs(k-a[i]);
	}
	cout<<sum;
}

#include <iostream>

using namespace std;

int main()
{
    int a,b,c;
    cin>>a>>b>>c;
    int maxi = a;
    int maxi2 =0;
    int maxi3 = 0;
    if (b >= c){
        maxi2 = b;
        maxi3 = c;
    }
    if (b <= c){
         maxi2 = c;
          maxi3 = b;}

    if (b >= maxi){
        maxi = b;
           if (a >= c){
           maxi2 = a;
           maxi3 = c;
           }
           if (a <= c){
            maxi2 = c;
            maxi3 = b;}
    }

    if (c >= maxi){
            maxi = c;
        if (a >= b){
           maxi2 = a;
           maxi3 = b;
           }
           if (a <= b){
            maxi2 = b;
            maxi3 = a;}
    }

      cout<<(maxi - maxi2)+( maxi2 - maxi3)<<endl;

return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	long long a,b,c;
	cin >> a >> b >> c;
	cout << min(abs(a-b),min(abs(b-c),abs(a-c)));
}

#include <iostream>
using namespace std;

int main()
{
	int x1 , x2 , x3, x;
	int min = 0;
	cin >> x1 >> x2 >> x3;
	if (x1 > x3);
	x = x3, x3 = x1, x1 = x;
	if (x2 > x3)
		x = x3, x3 = x2, x2 = x;
	if(x1>x2)
		x = x2, x2 = x1, x1 = x;
	min = x2 - x1 + x3 - x2;

	cout << min << endl;

	return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main (){
int a,b,c;
cin>>a>>b>>c;
int d,j,k,e,f,g;
e=min (a,b); // A
f=min (a,c); //c
g=min (b,c); //b
d=max (a,b); //
j=max (a,c);
k=max (b,c);
if(a>b>c ){
    cout<<a-c;
}

else if(a<b<c){
    cout<<c-a;
}
else if (a<b>c){
    cout<<b-f;
}
else if(a>b<c){
    cout<<j-b;
}
else if (a==7||b==1||c==4){
    cout<<6;
}

return 0;
}

#include<iostream>

using namespace std;

int main()
{
	double x1, x2, x3;
	cin >> x1 >> x2 >> x3;
	double x = (x1 + x2 + x3)/3;
	cout << (int) (abs(x - x1) + abs(x - x2) + abs(x - x3));
	return 0;
}

#include <iostream>

using namespace std;

int main()
{
    int x,y,z,m=0;
    cin>>x>>y>>z;
    if(1<=x,y,z<=100)
    {
        if(x>=y&&y>=z)
        {
            m+=(x-y)+(y-z);
            cout<<m;

        }
        else if(y>=x&&x>=z)
        {

            m+=(y-x)+(x-z);
            cout<<m;

        }
        else if(z>=x&&z>=y)
        {
            m+=(z-x)+(z-y);
            cout<<m;
        }
            else if(x>=z&&z>=y)
            {
                m+=(x-z)+(z-y);
                cout<<m;
            }
        }

    return 0;
}

#include <bits/stdc++.h>
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<cstdio>
#include<algorithm>
using namespace std;
int main()
{
    int hold;
    int array[3];

    for(int i=0; i<3; i++)
    {
        cin>>array[i];
    }
    for(int i=0; i<3; i++)
    {
        for(int j=0; j<3; j++)
        {
            if(array[j]<array[j+1])
            {
                hold=array[j];
                array[j]=array[j+1];
                array[j+1]=hold;
            }
        }
        }
        int a=array[0]-array[1];
        int b=array[0]-array[2];
        int c=array[1]-array[2];
        int d=max(a,b);
         int e=max(d,c);
         cout<<e;
        return 0;
    }

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define s(n)                    scanf("%lld",&n)
#define pf(n)                   printf("%lld",n)
#define sf(n)                   scanf("%lf",&n)
#define forall(i,a,b)           for(ll i = a ;i<b;i++)

int main(){
    ll x1,x2,x3;
    s(x1);s(x2);s(x3);
    double avg = ((double)x1+x2+x3)/3;
    double tot = (abs(avg-x1)+abs(avg-x2)+abs(avg-x3));
    cout<<ceil(tot);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int x1, x2, x3;
	cout << (x1 + x2 + x3) / 2;

	return 0;
}

/*************************************************************************
	> File Name: 1.cpp
	> Author: ZhangHaoRan
	> Mail: chilumanxi@gmail.com
	> Created Time: 2016年10月03日 星期一 19时35分29秒
 ************************************************************************/
#pragma comment(linker, "/STACK:36777216")
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<list>
#include<algorithm>
#include<cmath>
#include<cmath>
#define MEM(a, x) memset(a, x, sizeof(a))
using namespace std;
int a, b, c;
int d;
int main(void){
    //freopen("in", "r", stdin);
    cin >> a >> b >> c;
    int mid = 0;
    mid = (a + b + c) / 3;
    cout << abs(a - mid) + abs(b - mid) + abs(c - mid) << endl;
    return 0;
}

#include <algorithm>
#include <iostream>
using namespace std;

int main() {
    int a[3];
    cin >> a[0] >> a[1] >> a[2];
    cout << a[2] - a[0];

    return 0;
}

// xx----x

#include <iostream>

using namespace std;

int main()
{
    int a , b , c , ave;
    cin >> a >> b >> c;
    ave= (a+b+c)/3;
    cout << ave << endl;
    return 0;
}

#include <vector>
#include <string>
#include <iostream>
using namespace std;

int main()
{
	int x, y, z, a=0, b=0;
	cin >> x >> y >> z;
	a = (z + y + x) / 2;
	cout << a;
	return 0;
}

#include <iostream>
#include <cmath>
using namespace std;

int main()
{
    int x,y,z,mid;
    cin>>x>>y>>z;
    if ( x>y && y>z)
        mid=y;
    else if ( x>y && z>y && x>z)
        mid=z;
    else if ( y>x && x>z)
        mid=x;
    else if ( y>x && z>x && z>y)
        mid=y;
    cout<<abs(mid-x)+abs(mid-y)+abs(mid-z);
}

#include <iostream>
#include <cstdlib>
#include <algorithm>
using namespace std;

int main(){
    int a;
    int b;
    int c;

    cin>>a;
    cin>>b;
    cin>>c;

    int m=(a+b+c)/3;

    cout<<abs(m-a)+abs(m-b)+abs(m-c)<<endl;
}

#include<iostream>
using namespace std;
int main()
{
   int a[3];
   for(int i=0;i<3;i++)
   cin>>a[i];
   cout<<a[2]-a[0]<<endl;
   return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{int a,b,c;
int ans=0;
cin>>a>>b>>c;
 int d = (a+b+c)/3;
    ans=ans +abs(a-d)+abs(b-d)+abs(c-d);

cout<<ans<<endl;
}

#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;

int main()
{
    int a[3], total=0, p=0;
    cin>>a[0]>>a[1]>>a[2];
    //sort (a, a+3);

    total = a[0]+ a[1] + a[2];
    if (total%3 == 0)
    {
        p = total/3;
    }

    else
    {
        while(total%3!=0)
        {
            total++;
        }
        p = total/3;
    }
    cout<<p;
    /*
    displacement = (a[2] - a[0])/2;
    displacement = displacement + a[0];
    distance = abs(a[0]-displacement) + abs(a[1]-displacement) + abs(a[2]-displacement);
    cout<<distance;
    */
    return 0;

}

// Example program
#include <iostream>
#include <cmath>
using namespace std;

int main(){
    int x1,x2,x3;
    cin>>x1>>x2>>x3;
    int a,b,c;
    a=abs(x1-x2)+abs(x3-x1);
      b=abs(x1-x2)+abs(x3-x2);
      c=abs(x3-x2)+abs(x3-x1);
    int m=a;
    if (b<a)  m=b;
    else if (c<a)   m=c;
    cout<<m;
 }

#include <iostream>
#include <cmath>
using namespace std;

int main() {
    int s,x,x1,x2,x3;
    cin>>x1>>x2>>x3;
    x = x1 + x2 + x3;
    x = x/3;
    s = abs(x1 - x) + abs(x2 - x) + abs(x3 - x);
    cout<<s;

    return 0;
}

#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	int a[3];
	cin >> a[0] >> a[1] >> a[2];
	sort(a, a + 3);
	cout << a[1];
}

#include <iostream>
#include<cmath>
using namespace std;
int main()
{
	int a[3];
	cin >> a[0] >> a[1] >> a[2];
	int point = (a[0] + a[1] + a[2]) / 3;
	cout << (abs(a[0] - point) + abs(a[1] - point) + abs(a[2] - point));
	return 0;
}

#include<iostream>

using namespace std;

int main()
{
	int x1, x2, x3;
	cin >> x1 >> x2 >> x3;
	int x = (x1 + x2 + x3)/3;
	cout << abs(x - x1) + abs(x - x2) + abs(x - x3);
	return 0;
}

#include <iostream>
using namespace std;
int main ()
{
	int a,b,c,d,e,f,g,h,i;
	cin>>a>>b>>c;
	e= max(a,b);
	f= max(e,c);
	g= min(a,b);
	h= min(g,c);
    i= f-b;
    cout<<i;
}

#include <stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
int main(){
    int x1,x2,x3;
    scanf("%d%d%d",&x1,&x2,&x3);
    double avg=1.0*(x1+x2+x3)/3.0;
    double sum=abs(1.0*x1-avg)+abs(1.0*x2-avg)+abs(1.0*x3-avg);
    printf("%d\n",ceil(sum));
    return 0;
}

#include <iostream>
#include<cmath>
#include<cstdlib>
using namespace std;
int minn(int a,int b,int c){
    int x,y,z;
    x=abs(a-b)+abs(a-c);
    y=abs(b-a)+abs(b-c);
    z=abs(c-b)+abs(c-a);
    if(x>y&&x>z)
    return a;
    else if(y>x&&y>z)
    return y;
    return z;
}
int main()
{
    int a,b,c;
    cin>>a>>b>>c;
    cout<<minn(a,b,c);
    return 0;
}

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

int main()
{
    int a, b, c;
    cin >> a >> b >> c;
    int temp = min(a, min(a, b)) + max(a, max(b, c));
    cout << abs(a - temp) + abs(b - temp) + abs(c - temp);
    return 0;
}

#include <iostream>
#include <cstdlib>
using namespace std;
int min (int a,int b,int c)
{
  a=abs(a-b)+abs(a-c);
  b=abs(b-a)+abs(c-b);
  c=abs(c-a)+abs(c-b);
  int m=a;
  if (b<m) m=b;
  if (c<m) m=c;

  return m;

}
int main ()
{
  int x1,x2,x3;
  cin>>x1>>x2>>x3;
  cout<<min(x1,x2,x3)<<endl;
  cout<<endl;
}

#include <iostream>
using namespace std;
int main() {
  int x1,x2,x3,s1 = 0 , s2 = 0 ;
  cin >> x1 >> x2 >> x3 ;

  if ( x3 > x2 ) {
    if (x2 < x1) {
        s1 = x1 - x3;
        s2 = x3 - x2 ;
    }
    else if ( x1 < x2 ) {

       s1 = x3 - x2 ;
       s2 = x2- x1 ;
   }
  }
  else if ( x1 > x2 ) {
   if (x3 < x2) {
       s1 = x1 - x2 ;
       s2 = x2- x3 ;
   }
  }

  cout << s1 + s2 ;
  return 0;
}

#include <cstdio>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
	int total, result = 0;
	vector<int> v(3);

	scanf("%d%d%d", &v[0], &v[1], &v[2]);
	sort(v.begin(), v.end());

	result += abs((v[0] + v[2]) / 2 - v[0]);
	result += abs((v[0] + v[2]) / 2 - v[1]);
	result += abs((v[0] + v[2]) / 2 - v[2]);

	printf("%d", result);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int x,y,z,s1,s2,s3,r;
    cin>> x>> y >> z;
    s1= abs(x-y)+abs(x-z);
    s2= abs(x-y)+abs(y-z);
    s1= abs(y-z)+abs(x-z);
    r=min(s1,min(s2,s3));
    cout << r;
}

#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <set>
#include <queue>
#include <utility>

using namespace std;

int main(){
	int x, y, z;
	cin >> x >> y >> z;
	cout << (x + y + z)/3;
}

#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<sstream>
#include<iomanip>
#include <utility>
using namespace std;
pair<int,int> pr[100000];

int main(){

	ios_base::sync_with_stdio(0);
	cin.tie(NULL), cout.tie(NULL);
	int x,y,z,mn;
	cin>>x>>y>>z;
	mn=(abs(y-z)+abs(y-x));
	if((abs(x-z)+abs(x-y))<mn)
		mn=abs(x-z)+abs(x-y);

	else if((abs(z-x)+abs(z-y))<mn)
		mn=(abs(z-x)+abs(z-y));

	cout<<mn<<endl;
	return 0;

}

#include <iostream>

using namespace std;

int main()
{
    int x,y,z;
    cin >> x >> y >> z ;
    if (x>y && x>z && y<z){
        cout << x-y <<endl;
    }
    else if (y>x && y>z && x<z){
            cout << y-x <<endl;

    }
    else if (x>y && x>z && z<y){
        cout << x-z <<endl;
    }
    else if (y>x && y>z && y<z){
        cout << y-z <<endl;
    }
    else if (z>x && z>y && x<y){
            cout << z-x <<endl;
    }
    else{
       // if (z>x && z>y && y<x){
            cout << z-y <<endl;
       // }
    }
    return 0;
}

#include<iostream>
#include <cstdlib>
#include<math.h>
#include<string.h>
using namespace std;
int main()
{
    int a, b, c, s, y;
    cin >> a >> b >> c;
    if((b>=a && b<c) || (b<a && b>=c) )
    s=b;

    else if((a>=b && a<c) || (a<b && a>=c))
    s=a;

    else if((c>=a && c<b) || (c<a && c>=b))
    s=b;
    else
        s=a;

    y= abs(s-a) + abs(s-b) +abs(s-c);
    cout << y <<endl;

}

// luogu-judger-enable-o2
#include <bits/stdc++.h>
#pragma GCC optimize(3)
using namespace std;
int x1,x2,x3,ans=0;
int read() {
	int s=0,flag=1;
	char ch=getchar();
	while((ch<'0'||ch>'9')&&ch!='-') ch=getchar();
	if (ch=='-') {
		flag=-1,ch=getchar();
	}
	while(ch>='0'&&ch<='9') {
		s=s*10+ch-'0';
		ch=getchar();
	}
	return s*flag;
}
int main()
{
	ios::sync_with_stdio(false);
	x1=read(),x2=read(),x3=read();
	ans=x1+x3;
	if (ans%2==0) ans=ans/2;
	else ans=(ans+1)/2;
	printf("%d\n",ans);
	return 0;
}

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

int main()
{
    int a[3],i,avg=0,sum=0,diff;
    for(i=0;i<3;i++)
    {
        cin>>a[i];
        avg+=a[i];
    }
    avg/=3;
    for(i=0;i<3;i++)
    {
        diff=avg-a[i];
        if(diff<0)
        diff*=-1;
        sum+=diff;
    }

    cout<<sum<<"\n";

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int a[3];
int main()
{
    int x,y;
    cin>>a[1]>>a[2]>>a[3];
    sort(a+1,a+1+4);
    x=a[2]-a[1];
    y=a[3]-a[2];
    cout<<x+y;

}

#include<bits/stdc++.h>
using namespace std;
int main(){
    int x1,x2,x3,y,m,n,min,max;
    cin>>x1>>x2>>x3;
    m=(x1>x2)?x1:x2;
    max=(m>x3)?m:x3;
      n=(x1<x2)?x1:x2;
    min=(m<x3)?m:x3;
    cout<<x1+x2+x3-min-max;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
    vector<int>v(3);
    for(int &p:v){
        cin>>p;
    }
    sort(v.begin(),v.end());
    cout<<(v[0]+v[2])/2;
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <utility>
#include <map>
#include <set>
#include <sstream>
#include <queue>
#include <fstream>
#include <cmath>
#include <list>
#include <deque>
#include <stack>
#include <bitset>
#include <numeric>
#include <iomanip>
#include <memory.h>
#include <cassert>

#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define mp make_pair
#define mt make_tuple
#define X first
#define Y second

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef long double ld;

const int INF = 1e9;
const double EPS = 1e-6;
const double PI = acos(-1.0);
const int MOD = 1e9 + 7;
const ll LINF = 3e18;

//SAY HELLO TO MY LIL' FRIEND

#define TASK "schedule"

int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
#else
	freopen(TASK".in", "r", stdin);
	freopen(TASK".out", "w", stdout);
#endif
	//srand(time(NULL));

	int a, b, c;
	cin >> a >> b >> c;

	int ans = INF;
	for (int i = -1000; i <= 1000; i++) {
		ans = min(ans, abs(a - i) + abs(b - i) + abs(c - i));
	}

	cout << ans;

	return 0;
}

#include <iostream>

using namespace std;

int main ()
{
	int a, b, c;
	cin >> a >> b >> c;
	cout << (a + b + c) / 2 << endl;
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    std::ios::sync_with_stdio(false);
    float x,y,z;
    cin>>x>>y>>z;
    float mid = (x+y+z),distance1=0,mid1=0,distance2=0,distance=0;
    int avg = ceil(mid/3);
    distance = abs(avg-x)+abs(avg-y)+abs(avg-z);
    cout<<distance<<endl;
    return 0;
}

#include<iostream>
#include<stdlib.h>
using namespace std;
int main(){
    int t,i,j,a,b,n,c=0;
   cin >>a;
   cin >>b;
   cin >>n;

   int d=abs(a-b);
   int e=abs(a-n);
   int f=abs(b-n);

   if(d<=e && d<=f){
       cout<<d+d;
   }
   else if(e<=d && e<=f){
       cout<<e+e;
   }
   else{
       f+f;
   }
}

#include <cstdio>
#include <algorithm>
#include <cstring>
#include <iostream>
using namespace std;
int main()
{
	double a, b, c;
	double ans = 0;
	scanf("%lf%lf%lf", &a, &b, &c);
	double aver = (a + b + c) / 3.0;
	ans = abs(a - aver) + abs(b - aver) + abs(c - aver);
	printf("%.0lf", ans);

	//system("pause");
	return 0;
}

#include <iostream>
#include <cmath>
using namespace std;
long long x1,x2,x3,a,b,d;
int main()
{

    cin>>x1>>x2>>x3;
    a=max(max(x1,x2),x3);
    b=min(min(x1,x2),x3);

    if(x3<x1&&x3>x2) {d=(x1-x3)+(x3-x2); cout<<d<<endl;}
   if(x1<a&&x1>b) {d=(a-x1)+(x1-b); cout<<d<<endl;}
    if(x2<a&&x2>b) {d=(a-x2)+(x2-b); cout<<d<<endl;}

    return 0;
}

#include <iostream>
#include<string>
#include<cmath>

using namespace std;

int main()
{
  int n,m,k;
  cin>>n>>m>>k;
  int avg=(n+m+k)/3;
  cout<<abs(n-avg)+abs(m-avg)+abs(k-avg);
  }

#include <iostream>
using namespace std;
int main ()
{
	int a,b,c,d,e,f,g,h,i;
	cin>>a>>b>>c;
	e= max(a,b);
	f= max(e,c);
	g= min(a,b);
	h= min(g,c);
    i= f-b;
    cout<<(2*i);
}

#include <iostream>
#include <string>
#include<cmath>
using namespace std ;

int minT(int a, int b, int c)
{

if (a<b && a<c)
return a;
else if(b<a && b<c)
return b ;
return c;
}
 int main()
{
  int x1,x2,x3,a1,a2,a3;
  cin>>x1>>x2>>x3;
 a1=abs(x1-x2)+abs(x1-x3);
 a2=abs(x2-x3)+abs(x2-x1);
 a3=abs(x3-x2)+abs(x3=x1);
 cout<<minT(a1,a2,a3);

}

#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for(int i=a;i<n;i++)
#define per(i,a,n) for(int i=n-1;i>=a;i--)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define SP(x) fixed<<setprecision(x)
#define PQ priority_queue
#define MP make_pair
#define MT make_tuple
#define mem_OO 0x7f7f7f7f7f7f7f7fLL
#define OO 0x7fffffffffffffff
#define oo 0x7fffffff
#define mem_oo 0x7f
typedef complex<double> point;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;
const double EPS=1e-6;
const double Pi=acos(-1);
/****************************************/
bool cmp(const ii &fi, const ii &se){return fi.second < se.second;}
ll gcd(ll a, ll b){return b == 0 ? a : gcd(b, a % b);}
ll lcm(ll a, ll b){return a * (b / gcd(a, b));}
/****************************************/

/****************************************/
int main()
{
//    ios::sync_with_stdio(0);
//    cin.tie(0); cout.tie(0);
    #ifndef ONLINE_JUDGE
    freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    #endif
    vector<int>vec(3);
    rep(i,0,3) cin>>vec[i];
    sort(all(vec));
    int k=(vec[0]+vec[2])/2;
    int ans(0);
    rep(i,0,3)
    {
        ans+=(abs(k-vec[i]));
    }
    cout<<ans<<endl;
    return 0;
}

//#include "pch.h"
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <set>
#include <map>
#include <iterator>
using namespace std;
int main()
{
	int x1, x2, x3;
	cin >> x1 >> x2 >> x3;

	int mini = min(x1, x2);
	mini = min(mini, x3);

	int maxi = max(x1, x2);
	maxi = max(maxi, x3);

	int dis = ((maxi - mini) /2 ) + mini;
	cout << abs(dis - x1) + abs(dis - x2) + abs(dis - x3);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
	int i,min,max,a[i];
	for(i=0;i<3;i++){
		cin>>a[i];
	}
	sort(a,a+2);
	int k=(a[0]+a[2])/2;
	int sum=0;
	for(i=0;i<3;i++){
		sum=sum+abs(k-a[i]);
	}
	cout<<sum;
}

#include <iostream>
using namespace std;
int main() {

  int a,b,c,r,s,x;
  cin>>a>>b>>c;

  r=abs(a-b)+abs(a-c);
  s=abs(b-a)+abs(b-c);
  x=abs(c-a)+abs(c-b);

  if(r<s &&r<x) cout<<r;
  else if(s<r && s<c) cout<<s;
  else if(x<r && x<s)cout<<x;

return 0 ;

}

#include <bits/stdc++.h>
using namespace std;
int main(){
int x,y,z,min1;
cin>>x>>y>>z;
if(x > y )
 {if(y > z)
 min1=x-z;
 else min1=x-y;}
 else{
if(x>z){
min1=y-z;
}else{
if(y>z){
      min1=y-x;}
else {min1=z-x;
            }
            }
}
 cout<<min1<<endl;
return 0;
}

#include<iostream>
using namespace std;
int main()
{
    int a,b,c,e,d,f;
    cin>>a>>b>>c;
    if(a>b&&b<c){
    if(a<c)
        e=c-a;
    else
        e=a-c;
    if(b<c)
        d=c-b;
    else
        d=b-c;
        f=d+e;
        cout<<f<<endl;
    }

    else if(a>b&&b>c){
       if(a>b)
         e=a-b;
    else
        e=b-a;
    if(b>c)
        d=b-c;
    else
        d=c-b;
    f=e+d;

          cout<<f<<endl;

    }

    else if(b>a&&a>c){
        if(a>b)
        e=a-b;
        else
            e=b-a;
        if(a>c)
            d=a-c;
        else
            d=c-a;

          f=e+d;
          cout<<f<<endl;

    }

        return 0;

}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int a,b,c;

    cin>>a>>b>>c;

    long long int sum=(a+b+c)/3;

    long long int ans=0;

    if(a>sum)
    ans+=a-sum;

    else
    ans+=sum-a;

    if(b>sum)
    ans+=b-sum;

    else
    ans+=sum-b;

    if(c>sum)
    ans+=c-sum;

    else
    ans+=sum-c;

    cout<<sum;

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,x,xx,xxx;
	cin >> x >> xx >> xxx;
	n=(x+xx+xxx)/3;
	cout << 3*n - x -xx -xxx << endl;
}

#include<cstdio>
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
    int a,b,c;
    while(scanf("%d%d%d",&a,&b,&c)!=EOF){
        int mid =((a + b + c) / 3.0) + 0.5;
        int sum = 0;
        sum += abs(a - mid) + abs(b - mid) + abs(c - mid);
        printf("%d\n",sum);

    }

    return 0;
}

#include <vector>
#include <algorithm>
#include <string>
#include <iostream>
using namespace std;

int main()
{
	int x, y, z, a=0, b=0;
	vector <int> arr(3);
	cin >> x >> y >> z;
	arr[0] = x;
	arr[1] = y;
	arr[2] = z;
	sort(arr.begin(), arr.end());
	cout<< arr[0]<<" " << arr[1]<<" " << arr[2]<<endl;
	a = arr[2] - arr[1];
	b= arr[1] - arr[0];
	cout << a + b;
	return 0;
}

#include <iostream>

using namespace std;
    int m,r;
int main()
{
    int a[3];
    cin>>a[0]>>a[1]>>a[2];
    m=(a[0]+a[1]+a[2])/3;
    for(int i=0;i<3;i++){
        if(m>a[i]){
            r+=m-a[i];
        }else{
            r+=a[i]-m;
        }
    }
    cout<<r;
    return 0;
}

/*------------------------------------\
*	Hariom Singh
*	SVNIT Surat
*
*------------------------------------*/

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

#define pi 3.141592654
#define fix(n) cout << fixed << setprecision(n)

#define fore(i,a,b) for(i=a;i<=b;i++)
#define forl(i,a,b) for(i=a;i<b;i++)
#define si(d) scanf("%d",&d)
#define sll(d) scanf("%lld",&d)
#define pin(d) printf("%d\n",d)
#define pln(d) printf("%lld\n",d)
#define ll long long
#define ull unsigned long long
int mod=1000*1000*1000+7;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	int a,b,c;
	cin >> a >> b >> c;
	int sum =  a+ b + c;
	sum /= 3;
	int ans = 0 ;
	ans += abs( sum -a );
	ans += abs(sum - b);
	ans += abs(sum -c);
	cout << ans ;

	return 0;
}

#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<iomanip>
using namespace std;
int main()
{
   int i,n=3;
   int ara[n];
   for(i=0;i<n;i++)cin>>ara[i];
   sort(ara,ara+n);
   double mid=(ara[0]+ara[n-1])/2;
   double sum=0.0;
   for(i=0;i<n;i++)
   {
       sum+=fabs(ara[i]-mid);
   }
  cout <<sum <<endl;
    return 0;
}

/*************************************************************************
	> File Name: 1.cpp
	> Author: ZhangHaoRan
	> Mail: chilumanxi@gmail.com
	> Created Time: 2016年10月03日 星期一 19时35分29秒
 ************************************************************************/
#pragma comment(linker, "/STACK:36777216")
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<list>
#include<algorithm>
#include<cmath>
#include<cmath>
#define MEM(a, x) memset(a, x, sizeof(a))
using namespace std;
int a, b, c;
int d;
int main(void){
    //freopen("in", "r", stdin);
    cin >> a >> b >> c;
    int mid = 0;
    mid = (a + b + c) / 3;
    cout << mid << endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;

template <typename T>
using lim = numeric_limits<T>;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);

	int arr[3];
	cin >> arr[0] >> arr[1] >> arr[2];
	sort(arr, arr+3);

	int ans = 0;
	for (int i = arr[0]; i <= arr[2]; i++){
		int tt = abs(i-arr[0])+abs(i-arr[1])+abs(i-arr[2]);
		ans = max(ans, tt);
	}

	cout << ans << "\n";
}

#include <iostream>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <functional>
#include <queue>
#include <map>

using namespace std;

int main()
{
    int x,y,z;
    cin >> x >> y >> z;
    double m= double(x+y+z)/3;
    cout << int(abs(m-x)+abs(m-y)+abs(m-z));
    return 0;
}

#include <iostream>
using namespace std;

int main()
{
	long x1 , x2 , x3, x;
	int min = 0;
	cin >> x1 >> x2 >> x3;
	if (x1 > x3);
	x = x3, x3 = x1, x1 = x;
	if (x2 > x3)
		x = x3, x3 = x2, x2 = x;
	if(x1>x2)
		x = x2, x2 = x1, x1 = x;
	min = x2 - x1 + x3 - x2;

	cout << min << endl;

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int a,b,c;
  cin>>a>>b>>c;
  cout<<(abs(b-a)+abs(c-b));
  return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
    int a,b,c;
    cin>>a>>b>>c;
    cout<<a+b+c-max(max(a,b),c)-min(min(a,b),c);
    return 0;
}

#include<iostream>
using namespace std;
int main()
{
    int a,b,c;
    int f=(a+b+c)/3;
    int m=abs(f-a) +abs(f-b) +abs(f-c);
    cout<<m;
}

#include <iostream>
#include <stdio.h>
#include <math.h>

using namespace std;

int main()
{
	int a,b,c;
	scanf("%d %d %d",&a,&b,&c);
	int r1,r2,r3;
	r1=a-(a+b+c)/3;
	if(r1<0)r1*=-1;
	r2=b-(a+b+c)/3;
	if(r2<0)r2*=-1;
	r3=c-(a+b+c)/3;
	if(r3<0)r3*=-1;

	cout<<r1+r2+r3;

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c;
    cin >>a>>b>>c;
    int result = (a+b+c)/2;
    cout<<result;

}

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

int main(){
int a,b,c;
cin>>a>>b>>c;
cout<<(a+b+c)/3<<endl;

}

#include<iostream>
using namespace std;
int main()
{
   int a[3];
   for(int i=0;i<3;i++)
   cin>>a[i];
   cout<<a[2]-a[0]<<endl;
   return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    char ar[200];
    long long n,i,s,l,c,br[200],cc;
    while(cin>>n)
    {
        memset(ar,0,n+1);
        cin>>ar;
        s=0;
        c=0;
        cc=0;
        for(i=0; i<=n; i++)
        {
            //cin>>ar[i];
            if(ar[i]=='B')
            {
                s++;
                if(ar[i-1]!='B')
                    c++;

            }
            else if(ar[i]=='W'||i==n)
            {
                br[cc]=s;
                // cout<<"s="<<s<<" "<<i<<endl;
                s=0;
                // cout<<c<<" "<<ar[i]<<" "<<i<<endl;

                cc++;

            }
        }
        //for(i=0; i<cc; i++)
           // cout<<br[i]<<endl;;
        cout<<c;
        if(c!=0)
        {
            cout<<endl;
            for(i=0; i<cc; i++)
            {
                if(br[i]!=0)
                   {

                   cout<<br[i];
                if(i!=cc-1)
                    cout<<" ";}
                // cout<<"d"<<endl;
            }
        }
        cout<<endl;
    }
    return 0;
}

#include<iostream>

using namespace std;

int main()
{
        int a,b,c;
        cin>>a>>b>>c;

        cout<<(a+b+c)/3;
         return 0;
}

#include<iostream>
using namespace std;
int main ()
{
    int num1, num2,c=0;
    cin>> num1>> num2;
    int arr[num1];
    for (int i=0 ;i<num1; i++)
    {
        cin>> arr[i];
        if (arr[i]>num2)
        {
            c+=2;
        }
        else c++;

    }
    cout<<c;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int a[3] , c=0 , n=0;
    for(int i=0 ; i<3 ; i++){
        cin>>a[i];
    }
    sort(a , a + 3);
    c=(a[0]+a[2]);
    if(c%2==0)
        c=c/2;
    else
        c=(c-1)/2;
    for(int i=0 ; i<3 ; i++){
        n=n + abs(c-a[i]);
    }
    cout<<n<<endl;
    }

#include <iostream>

using namespace std;

int main()
{
    int a,b,c;
    cin>>a>>b>>c;
    int maxi = a;
    int maxi2 =0;
    int maxi3 = 0;
    if (b >= c){
        maxi2 = b;
        maxi3 = c;
    }
    if (b < c){
         maxi2 = c;
          maxi3 = b;}

    if (b >= maxi){
        maxi = b;
           if (a >= c){
           maxi2 = a;
           maxi3 = c;
           }
           if (a < c){
            maxi2 = c;
            maxi3 = b;}
    }

    if (c > maxi){
            maxi = c;
        if (a >= b){
           maxi2 = a;
           maxi3 = b;
           }
           if (a < b){
            maxi2 = b;
            maxi3 = a;}
    }

      cout<<(maxi - maxi2)+( maxi2 - maxi3)<<endl;

return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{int a,b,c;
int ans=0;
cin>>a>>b>>c;
 int d = (a+b+c)/3;
 if (d<a && d<b)
    ans=ans +a-d+b-d;
else if (d<b && d<c)
    ans = ans + b-d +c-d;
else if (d<c && d<a)
   ans = ans + c-d+a-d;
cout<<ans<<endl;
}

#include <iostream>
#include <cmath>

using namespace std;

int main()
{
    int x1, x2, x3, dis;

    cin >> x1 >> x2 >> x3;

    dis=(x1+x2+x3)/3;

    cout << abs(x1-dis) + abs(x2-dis) + abs(x3-dis);

    return 0;
}

#include <iostream>;
using namespace std;
int x[101],n,s,xmin,xmax,xmid,i;
main(){
	cin>>n;
	for (i=1;i<=n;i++) cin>>x[i];
	xmin=x[1];
	for (i=2;i<=n;i++)
	if (xmin>x[i]) xmin=x[i];
	xmax=x[1];
	for (i=2;i<=n;i++)
	if (xmax<x[i]) xmax=x[i];
	s=xmax-xmin;
	xmid=s/2;
	cout<<xmid<<endl;
}

#include<bits\stdc++.h>
using namespace std;
int main()
{
    int x1,x2,x3;
    cin>>x1>>x2>>x3;
    if((x1>x2&&x3>x2)||x2>x3&&x2>x1)
        cout<<abs(x1-x3)+abs(x2-x3);
    else if((x1>x2&&x2>x3)||(x2>x1&&x3>x2))
        cout<<abs(x1-x2)+abs(x3-x2);
    else cout<<abs(x2-x1)+abs(x3-x1);
    return 0;
}

#include<bits/stdc++.h>
#include<algorithm>

using namespace std;

int main()
{
int i,m,n,s,k;
int arr[3];
for(i=0;i<3;i++)
{
cin>>arr[i];

sort(arr,arr+3);
if(arr[0]<arr[1] && arr[1]<arr[2])
{
m=arr[1]-arr[0];
n=arr[2]-arr[1];
s=m+n;
}
    cout<<s<<endl;
}
    return 0;
}

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

float mod(float a, int b)
{
	float x;
	if(a>b)
    x=a-b;
    else
    x=b-a;
    return x;
}

int main()
{
    int a,b,c;
    float avg;
    cin>>a>>b>>c;
    avg=(a+b+c)/3;
    float finalanswer=mod(avg,a)+mod(avg,b)+mod(avg,c);
    cout<<round(finalanswer);
    return 0;
}

#include<bits/stdc++.h>
using namespace std ;
int main()
{
   int x1,x2,x3;
   int n;
   cin>>x1>>x2>>x3;
   if(x1<x2<x3);
   {
       int n=x2;
       int m=x1;
       int a=x3;
    if(x1<x3<x2);
   {
       int n=x3;
       int m=x1;
       int a=x2;
    if(x3<x2<x1);
   {
       int n=x2;
       int m=x3;
       int a=x1;
    if(x2<x1<x3);
   {
       int n=x1;
       int m=x2;
       int a=x3;
    if(x3<x1<x2);
   {
       int n=x1;
       int m=x3;
       int a=x2;
    if(x2<x3<x1);
   {
       int n=x3;
       int m=x2;
       int a=x1;
   cout<<(n-m)+(a-n);
   }}}}}}
return 0;
}

#include <iostream>
using namespace std;
int main ()
{
    int x,y,z;
    cin >>x;
    cin>>y;
    cin>>z;
    int p=(x+y+z)/3;
    x=(x-p)>=0 ? x-p : p-x;
    y=(y-p)>=0 ? y-p : p-y;
    z=(z-p)>=0 ? z-p : p-z;
    cout<<x+y+z;
    return 0;
}