import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main{

	public static int min(int[] a)
	{
		int min = a[0];
		for (int i = 0; i < a.length; i++) {
			if(a[i]<min && a [i]!=-1)
			{	min=a[i];
				a[i]=-1;
				System.out.println(a[i]);
			}	
		}
		return min;	
	}
	
	
	public static void main(String[] args) throws IOException{
		// TODO Auto-generated method stub
		
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		
		int x,y,z;
		
		String s = reader.readLine();
		String[] inp = s.split(" ");
		
		x=Integer.parseInt(inp[0]);
		y=Integer.parseInt(inp[1]);
		z=Integer.parseInt(inp[2]);
		
		int[] arr = new int[3];
		arr[0]=x;arr[1]=y;arr[2]=z;
		
		int cost=0;
		
		int a  = Math.min(x,Math.min(y,z));
				
		if(a==x)
		{
			int b = Math.max(y,z);
			cost=cost+Math.abs(b-a);
			
			cost=cost+(Math.max(y,z)-b);
			
		}
		else if(a==y)
		{
			int b = Math.max(x,z);
			cost=cost+Math.abs(b-a);
			
			cost=cost+(Math.max(x,z)-b);
			
		}
		else if(a==z)
		{
			int b = Math.max(x,y);
			cost=cost+Math.abs(b-a);
			
			cost=cost+(Math.max(x,y)-b);
		}

		System.out.println(cost);
	}

}

/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz