import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] array = new int[3];
		for(int i = 0; i < array.length; i++)
			array[i] = sc.nextInt();
		Arrays.sort(array);
		int cost = 0;
		for(int i = 0; i < array.length-1; i++) 
			cost += Math.abs(array[i] - array[i+1]);
		System.out.println(cost);
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] array = new int[3];
		for(int i = 0; i < array.length; i++)
			array[i] = sc.nextInt();
		Arrays.sort(array);
		int cost = 0;
		for(int i = 0; i < array.length-1; i++) 
			cost += Math.abs(array[i] - array[i+1]);
		System.out.println(cost);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] array = new int[3];
		for(int i = 0; i < array.length; i++)
			array[i] = sc.nextInt();
		Arrays.sort(array);
		int cost = 0;
		for(int i = 0; i < array.length-1; i++) 
			cost += Math.abs(array[i] - array[i+1]);
		System.out.println(cost);
	} main {
		Scanner sc = new Scanner(System.in);
		int[] array = new int[3];
		for(int i = 0; i < array.length; i++)
			array[i] = sc.nextInt();
		Arrays.sort(array);
		int cost = 0;
		for(int i = 0; i < array.length-1; i++) 
			cost += Math.abs(array[i] - array[i+1]);
		System.out.println(cost);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] array = new int[3]; array new int[3] 3 for(int i = 0; i < array.length; i++)
			array[i] = sc.nextInt(); int i = 0; int i = 0; i 0 i < array.length i array.length array array.length i++ i++ i array[i] = sc.nextInt(); array[i] = sc.nextInt() array[i] array i sc.nextInt() sc.nextInt sc Arrays.sort(array) Arrays.sort Arrays array int cost = 0; cost 0 for(int i = 0; i < array.length-1; i++) 
			cost += Math.abs(array[i] - array[i+1]); int i = 0; int i = 0; i 0 i < array.length-1 i array.length-1 array.length array array.length 1 i++ i++ i cost += Math.abs(array[i] - array[i+1]); cost += Math.abs(array[i] - array[i+1]) cost Math.abs(array[i] - array[i+1]) Math.abs Math array[i] - array[i+1] array[i] array i array[i+1] array i+1 i 1 System.out.println(cost) System.out.println System.out System System.out cost String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] array = new int[3];
		for(int i = 0; i < array.length; i++)
			array[i] = sc.nextInt();
		Arrays.sort(array);
		int cost = 0;
		for(int i = 0; i < array.length-1; i++) 
			cost += Math.abs(array[i] - array[i+1]);
		System.out.println(cost);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] array = new int[3];
		for(int i = 0; i < array.length; i++)
			array[i] = sc.nextInt();
		Arrays.sort(array);
		int cost = 0;
		for(int i = 0; i < array.length-1; i++) 
			cost += Math.abs(array[i] - array[i+1]);
		System.out.println(cost);
	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] array = new int[3];
		for(int i = 0; i < array.length; i++)
			array[i] = sc.nextInt();
		Arrays.sort(array);
		int cost = 0;
		for(int i = 0; i < array.length-1; i++) 
			cost += Math.abs(array[i] - array[i+1]);
		System.out.println(cost);
	}
}
