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];
		array[0] = sc.nextInt();
		array[1] = sc.nextInt();
		array[2] = sc.nextInt();
		Arrays.sort(array);

		int cost2 = array[1] - array[0];
		int cost3 = array[2] - array[1];
		int totalCost = cost2 + cost3;

		System.out.println(totalCost);

	}
} 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];
		array[0] = sc.nextInt();
		array[1] = sc.nextInt();
		array[2] = sc.nextInt();
		Arrays.sort(array);

		int cost2 = array[1] - array[0];
		int cost3 = array[2] - array[1];
		int totalCost = cost2 + cost3;

		System.out.println(totalCost);

	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] array = new int[3];
		array[0] = sc.nextInt();
		array[1] = sc.nextInt();
		array[2] = sc.nextInt();
		Arrays.sort(array);

		int cost2 = array[1] - array[0];
		int cost3 = array[2] - array[1];
		int totalCost = cost2 + cost3;

		System.out.println(totalCost);

	} main {
		Scanner sc = new Scanner(System.in);
		int[] array = new int[3];
		array[0] = sc.nextInt();
		array[1] = sc.nextInt();
		array[2] = sc.nextInt();
		Arrays.sort(array);

		int cost2 = array[1] - array[0];
		int cost3 = array[2] - array[1];
		int totalCost = cost2 + cost3;

		System.out.println(totalCost);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] array = new int[3]; array new int[3] 3 array[0] = sc.nextInt() array[0] array 0 sc.nextInt() sc.nextInt sc array[1] = sc.nextInt() array[1] array 1 sc.nextInt() sc.nextInt sc array[2] = sc.nextInt() array[2] array 2 sc.nextInt() sc.nextInt sc Arrays.sort(array) Arrays.sort Arrays array int cost2 = array[1] - array[0]; cost2 array[1] - array[0] array[1] array 1 array[0] array 0 int cost3 = array[2] - array[1]; cost3 array[2] - array[1] array[2] array 2 array[1] array 1 int totalCost = cost2 + cost3; totalCost cost2 + cost3 cost2 cost3 System.out.println(totalCost) System.out.println System.out System System.out totalCost String[] args args public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] array = new int[3];
		array[0] = sc.nextInt();
		array[1] = sc.nextInt();
		array[2] = sc.nextInt();
		Arrays.sort(array);

		int cost2 = array[1] - array[0];
		int cost3 = array[2] - array[1];
		int totalCost = cost2 + cost3;

		System.out.println(totalCost);

	}
} public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] array = new int[3];
		array[0] = sc.nextInt();
		array[1] = sc.nextInt();
		array[2] = sc.nextInt();
		Arrays.sort(array);

		int cost2 = array[1] - array[0];
		int cost3 = array[2] - array[1];
		int totalCost = cost2 + cost3;

		System.out.println(totalCost);

	}
} 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];
		array[0] = sc.nextInt();
		array[1] = sc.nextInt();
		array[2] = sc.nextInt();
		Arrays.sort(array);

		int cost2 = array[1] - array[0];
		int cost3 = array[2] - array[1];
		int totalCost = cost2 + cost3;

		System.out.println(totalCost);

	}
}
