import java.util.Scanner;


public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int input[] = new int[3];
		
		Scanner sc = new Scanner(System.in);
		
		for(int i = 0; i < 3; i++){
			input[i] = sc.nextInt();
		}
		
		int order[][] = {{0,1,2},{0,2,1},{1,0,2},{1,2,0},{2,1,0},{2,0,1}};
		
		int result = Integer.MAX_VALUE;
		for(int i = 0; i < order.length; i++){
			int tmpTotal = 0;
			int prev = input[order[i][0]];
			
			for(int j = 1; j < 3; j++){
				tmpTotal += Math.abs(prev - input[order[i][j]]);
			}
			
			result = Math.min(result, tmpTotal);
		}
		
		System.out.println(result);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int input[] = new int[3];
		
		Scanner sc = new Scanner(System.in);
		
		for(int i = 0; i < 3; i++){
			input[i] = sc.nextInt();
		}
		
		int order[][] = {{0,1,2},{0,2,1},{1,0,2},{1,2,0},{2,1,0},{2,0,1}};
		
		int result = Integer.MAX_VALUE;
		for(int i = 0; i < order.length; i++){
			int tmpTotal = 0;
			int prev = input[order[i][0]];
			
			for(int j = 1; j < 3; j++){
				tmpTotal += Math.abs(prev - input[order[i][j]]);
			}
			
			result = Math.min(result, tmpTotal);
		}
		
		System.out.println(result);
	}

} Main /**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int input[] = new int[3];
		
		Scanner sc = new Scanner(System.in);
		
		for(int i = 0; i < 3; i++){
			input[i] = sc.nextInt();
		}
		
		int order[][] = {{0,1,2},{0,2,1},{1,0,2},{1,2,0},{2,1,0},{2,0,1}};
		
		int result = Integer.MAX_VALUE;
		for(int i = 0; i < order.length; i++){
			int tmpTotal = 0;
			int prev = input[order[i][0]];
			
			for(int j = 1; j < 3; j++){
				tmpTotal += Math.abs(prev - input[order[i][j]]);
			}
			
			result = Math.min(result, tmpTotal);
		}
		
		System.out.println(result);
	} main {
		// TODO Auto-generated method stub
		int input[] = new int[3];
		
		Scanner sc = new Scanner(System.in);
		
		for(int i = 0; i < 3; i++){
			input[i] = sc.nextInt();
		}
		
		int order[][] = {{0,1,2},{0,2,1},{1,0,2},{1,2,0},{2,1,0},{2,0,1}};
		
		int result = Integer.MAX_VALUE;
		for(int i = 0; i < order.length; i++){
			int tmpTotal = 0;
			int prev = input[order[i][0]];
			
			for(int j = 1; j < 3; j++){
				tmpTotal += Math.abs(prev - input[order[i][j]]);
			}
			
			result = Math.min(result, tmpTotal);
		}
		
		System.out.println(result);
	} int input[] = new int[3]; input new int[3] 3 Scanner sc = new Scanner(System.in); sc new Scanner(System.in) for(int i = 0; i < 3; i++){
			input[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			input[i] = sc.nextInt();
		} {
			input[i] = sc.nextInt();
		} input[i] = sc.nextInt() input[i] input i sc.nextInt() sc.nextInt sc int order[][] = {{0,1,2},{0,2,1},{1,0,2},{1,2,0},{2,1,0},{2,0,1}}; order {{0,1,2},{0,2,1},{1,0,2},{1,2,0},{2,1,0},{2,0,1}} {0,1,2} 0 1 2 {0,2,1} 0 2 1 {1,0,2} 1 0 2 {1,2,0} 1 2 0 {2,1,0} 2 1 0 {2,0,1} 2 0 1 int result = Integer.MAX_VALUE; result Integer.MAX_VALUE Integer Integer.MAX_VALUE for(int i = 0; i < order.length; i++){
			int tmpTotal = 0;
			int prev = input[order[i][0]];
			
			for(int j = 1; j < 3; j++){
				tmpTotal += Math.abs(prev - input[order[i][j]]);
			}
			
			result = Math.min(result, tmpTotal);
		} int i = 0; int i = 0; i 0 i < order.length i order.length order order.length i++ i++ i {
			int tmpTotal = 0;
			int prev = input[order[i][0]];
			
			for(int j = 1; j < 3; j++){
				tmpTotal += Math.abs(prev - input[order[i][j]]);
			}
			
			result = Math.min(result, tmpTotal);
		} {
			int tmpTotal = 0;
			int prev = input[order[i][0]];
			
			for(int j = 1; j < 3; j++){
				tmpTotal += Math.abs(prev - input[order[i][j]]);
			}
			
			result = Math.min(result, tmpTotal);
		} int tmpTotal = 0; tmpTotal 0 int prev = input[order[i][0]]; prev input[order[i][0]] input order[i][0] order[i] order i 0 for(int j = 1; j < 3; j++){
				tmpTotal += Math.abs(prev - input[order[i][j]]);
			} int j = 1; int j = 1; j 1 j < 3 j 3 j++ j++ j {
				tmpTotal += Math.abs(prev - input[order[i][j]]);
			} {
				tmpTotal += Math.abs(prev - input[order[i][j]]);
			} tmpTotal += Math.abs(prev - input[order[i][j]]) tmpTotal Math.abs(prev - input[order[i][j]]) Math.abs Math prev - input[order[i][j]] prev input[order[i][j]] input order[i][j] order[i] order i j result = Math.min(result, tmpTotal) result Math.min(result, tmpTotal) Math.min Math result tmpTotal System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int input[] = new int[3];
		
		Scanner sc = new Scanner(System.in);
		
		for(int i = 0; i < 3; i++){
			input[i] = sc.nextInt();
		}
		
		int order[][] = {{0,1,2},{0,2,1},{1,0,2},{1,2,0},{2,1,0},{2,0,1}};
		
		int result = Integer.MAX_VALUE;
		for(int i = 0; i < order.length; i++){
			int tmpTotal = 0;
			int prev = input[order[i][0]];
			
			for(int j = 1; j < 3; j++){
				tmpTotal += Math.abs(prev - input[order[i][j]]);
			}
			
			result = Math.min(result, tmpTotal);
		}
		
		System.out.println(result);
	}

} public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int input[] = new int[3];
		
		Scanner sc = new Scanner(System.in);
		
		for(int i = 0; i < 3; i++){
			input[i] = sc.nextInt();
		}
		
		int order[][] = {{0,1,2},{0,2,1},{1,0,2},{1,2,0},{2,1,0},{2,0,1}};
		
		int result = Integer.MAX_VALUE;
		for(int i = 0; i < order.length; i++){
			int tmpTotal = 0;
			int prev = input[order[i][0]];
			
			for(int j = 1; j < 3; j++){
				tmpTotal += Math.abs(prev - input[order[i][j]]);
			}
			
			result = Math.min(result, tmpTotal);
		}
		
		System.out.println(result);
	}

} Main
import java.util.Scanner;


public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int input[] = new int[3];
		
		Scanner sc = new Scanner(System.in);
		
		for(int i = 0; i < 3; i++){
			input[i] = sc.nextInt();
		}
		
		int order[][] = {{0,1,2},{0,2,1},{1,0,2},{1,2,0},{2,1,0},{2,0,1}};
		
		int result = Integer.MAX_VALUE;
		for(int i = 0; i < order.length; i++){
			int tmpTotal = 0;
			int prev = input[order[i][0]];
			
			for(int j = 1; j < 3; j++){
				tmpTotal += Math.abs(prev - input[order[i][j]]);
			}
			
			result = Math.min(result, tmpTotal);
		}
		
		System.out.println(result);
	}

}
