import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int[] tasks = new int[3];

		tasks[0] = sc.nextInt();
		tasks[1] = sc.nextInt();
		tasks[2] = sc.nextInt();

		int minimumCost = Integer.MAX_VALUE;

		for (int i = 0; i < 3; i++) {
			int firstTask = tasks[i];
			int c1 = Math.abs(tasks[(i+1)%3]-firstTask) + Math.abs(tasks[(i+2)%3]-tasks[(i+1)%3]);
			int c2 = Math.abs(tasks[(i+2)%3]-firstTask) + Math.abs(tasks[(i+1)%3]-tasks[(i+2)%3]);
			int cost = Math.min(c1,c2); 
			minimumCost = Math.min(minimumCost, cost);
		}
		System.out.println(minimumCost);
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int[] tasks = new int[3];

		tasks[0] = sc.nextInt();
		tasks[1] = sc.nextInt();
		tasks[2] = sc.nextInt();

		int minimumCost = Integer.MAX_VALUE;

		for (int i = 0; i < 3; i++) {
			int firstTask = tasks[i];
			int c1 = Math.abs(tasks[(i+1)%3]-firstTask) + Math.abs(tasks[(i+2)%3]-tasks[(i+1)%3]);
			int c2 = Math.abs(tasks[(i+2)%3]-firstTask) + Math.abs(tasks[(i+1)%3]-tasks[(i+2)%3]);
			int cost = Math.min(c1,c2); 
			minimumCost = Math.min(minimumCost, cost);
		}
		System.out.println(minimumCost);
		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int[] tasks = new int[3];

		tasks[0] = sc.nextInt();
		tasks[1] = sc.nextInt();
		tasks[2] = sc.nextInt();

		int minimumCost = Integer.MAX_VALUE;

		for (int i = 0; i < 3; i++) {
			int firstTask = tasks[i];
			int c1 = Math.abs(tasks[(i+1)%3]-firstTask) + Math.abs(tasks[(i+2)%3]-tasks[(i+1)%3]);
			int c2 = Math.abs(tasks[(i+2)%3]-firstTask) + Math.abs(tasks[(i+1)%3]-tasks[(i+2)%3]);
			int cost = Math.min(c1,c2); 
			minimumCost = Math.min(minimumCost, cost);
		}
		System.out.println(minimumCost);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);

		int[] tasks = new int[3];

		tasks[0] = sc.nextInt();
		tasks[1] = sc.nextInt();
		tasks[2] = sc.nextInt();

		int minimumCost = Integer.MAX_VALUE;

		for (int i = 0; i < 3; i++) {
			int firstTask = tasks[i];
			int c1 = Math.abs(tasks[(i+1)%3]-firstTask) + Math.abs(tasks[(i+2)%3]-tasks[(i+1)%3]);
			int c2 = Math.abs(tasks[(i+2)%3]-firstTask) + Math.abs(tasks[(i+1)%3]-tasks[(i+2)%3]);
			int cost = Math.min(c1,c2); 
			minimumCost = Math.min(minimumCost, cost);
		}
		System.out.println(minimumCost);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] tasks = new int[3]; tasks new int[3] 3 tasks[0] = sc.nextInt() tasks[0] tasks 0 sc.nextInt() sc.nextInt sc tasks[1] = sc.nextInt() tasks[1] tasks 1 sc.nextInt() sc.nextInt sc tasks[2] = sc.nextInt() tasks[2] tasks 2 sc.nextInt() sc.nextInt sc int minimumCost = Integer.MAX_VALUE; minimumCost Integer.MAX_VALUE Integer Integer.MAX_VALUE for (int i = 0; i < 3; i++) {
			int firstTask = tasks[i];
			int c1 = Math.abs(tasks[(i+1)%3]-firstTask) + Math.abs(tasks[(i+2)%3]-tasks[(i+1)%3]);
			int c2 = Math.abs(tasks[(i+2)%3]-firstTask) + Math.abs(tasks[(i+1)%3]-tasks[(i+2)%3]);
			int cost = Math.min(c1,c2); 
			minimumCost = Math.min(minimumCost, cost);
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			int firstTask = tasks[i];
			int c1 = Math.abs(tasks[(i+1)%3]-firstTask) + Math.abs(tasks[(i+2)%3]-tasks[(i+1)%3]);
			int c2 = Math.abs(tasks[(i+2)%3]-firstTask) + Math.abs(tasks[(i+1)%3]-tasks[(i+2)%3]);
			int cost = Math.min(c1,c2); 
			minimumCost = Math.min(minimumCost, cost);
		} {
			int firstTask = tasks[i];
			int c1 = Math.abs(tasks[(i+1)%3]-firstTask) + Math.abs(tasks[(i+2)%3]-tasks[(i+1)%3]);
			int c2 = Math.abs(tasks[(i+2)%3]-firstTask) + Math.abs(tasks[(i+1)%3]-tasks[(i+2)%3]);
			int cost = Math.min(c1,c2); 
			minimumCost = Math.min(minimumCost, cost);
		} int firstTask = tasks[i]; firstTask tasks[i] tasks i int c1 = Math.abs(tasks[(i+1)%3]-firstTask) + Math.abs(tasks[(i+2)%3]-tasks[(i+1)%3]); c1 Math.abs(tasks[(i+1)%3]-firstTask) + Math.abs(tasks[(i+2)%3]-tasks[(i+1)%3]) Math.abs(tasks[(i+1)%3]-firstTask) Math.abs Math tasks[(i+1)%3]-firstTask tasks[(i+1)%3] tasks (i+1)%3 (i+1) i 1 3 firstTask Math.abs(tasks[(i+2)%3]-tasks[(i+1)%3]) Math.abs Math tasks[(i+2)%3]-tasks[(i+1)%3] tasks[(i+2)%3] tasks (i+2)%3 (i+2) i 2 3 tasks[(i+1)%3] tasks (i+1)%3 (i+1) i 1 3 int c2 = Math.abs(tasks[(i+2)%3]-firstTask) + Math.abs(tasks[(i+1)%3]-tasks[(i+2)%3]); c2 Math.abs(tasks[(i+2)%3]-firstTask) + Math.abs(tasks[(i+1)%3]-tasks[(i+2)%3]) Math.abs(tasks[(i+2)%3]-firstTask) Math.abs Math tasks[(i+2)%3]-firstTask tasks[(i+2)%3] tasks (i+2)%3 (i+2) i 2 3 firstTask Math.abs(tasks[(i+1)%3]-tasks[(i+2)%3]) Math.abs Math tasks[(i+1)%3]-tasks[(i+2)%3] tasks[(i+1)%3] tasks (i+1)%3 (i+1) i 1 3 tasks[(i+2)%3] tasks (i+2)%3 (i+2) i 2 3 int cost = Math.min(c1,c2); cost Math.min(c1,c2) Math.min Math c1 c2 minimumCost = Math.min(minimumCost, cost) minimumCost Math.min(minimumCost, cost) Math.min Math minimumCost cost System.out.println(minimumCost) System.out.println System.out System System.out minimumCost sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int[] tasks = new int[3];

		tasks[0] = sc.nextInt();
		tasks[1] = sc.nextInt();
		tasks[2] = sc.nextInt();

		int minimumCost = Integer.MAX_VALUE;

		for (int i = 0; i < 3; i++) {
			int firstTask = tasks[i];
			int c1 = Math.abs(tasks[(i+1)%3]-firstTask) + Math.abs(tasks[(i+2)%3]-tasks[(i+1)%3]);
			int c2 = Math.abs(tasks[(i+2)%3]-firstTask) + Math.abs(tasks[(i+1)%3]-tasks[(i+2)%3]);
			int cost = Math.min(c1,c2); 
			minimumCost = Math.min(minimumCost, cost);
		}
		System.out.println(minimumCost);
		sc.close();
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int[] tasks = new int[3];

		tasks[0] = sc.nextInt();
		tasks[1] = sc.nextInt();
		tasks[2] = sc.nextInt();

		int minimumCost = Integer.MAX_VALUE;

		for (int i = 0; i < 3; i++) {
			int firstTask = tasks[i];
			int c1 = Math.abs(tasks[(i+1)%3]-firstTask) + Math.abs(tasks[(i+2)%3]-tasks[(i+1)%3]);
			int c2 = Math.abs(tasks[(i+2)%3]-firstTask) + Math.abs(tasks[(i+1)%3]-tasks[(i+2)%3]);
			int cost = Math.min(c1,c2); 
			minimumCost = Math.min(minimumCost, cost);
		}
		System.out.println(minimumCost);
		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int[] tasks = new int[3];

		tasks[0] = sc.nextInt();
		tasks[1] = sc.nextInt();
		tasks[2] = sc.nextInt();

		int minimumCost = Integer.MAX_VALUE;

		for (int i = 0; i < 3; i++) {
			int firstTask = tasks[i];
			int c1 = Math.abs(tasks[(i+1)%3]-firstTask) + Math.abs(tasks[(i+2)%3]-tasks[(i+1)%3]);
			int c2 = Math.abs(tasks[(i+2)%3]-firstTask) + Math.abs(tasks[(i+1)%3]-tasks[(i+2)%3]);
			int cost = Math.min(c1,c2); 
			minimumCost = Math.min(minimumCost, cost);
		}
		System.out.println(minimumCost);
		sc.close();
	}
}
