import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int []A = new int[3];
		for(int i = 0; i < 3; i++) {
			A[i] = scan.nextInt();
		}
		scan.close();
		int ans = 0;

		// 0
		int t = Math.abs(A[1] - A[0]);
		t += Math.abs(A[2] - A[1]);
		ans = t;

		t = Math.abs(A[2] - A[0]);
		t += Math.abs(A[1] - A[2]);
		ans = Math.min(ans, t);

		// 1
		t = Math.abs(A[0] - A[1]);
		t += Math.abs(A[2] - A[0]);
		ans = Math.min(ans, t);

		t = Math.abs(A[2] - A[1]);
		t += Math.abs(A[0] - A[2]);
		ans = Math.min(ans, t);

		// 2
		t = Math.abs(A[0] - A[2]);
		t += Math.abs(A[1] - A[0]);
		ans = Math.min(ans, t);

		t = Math.abs(A[1] - A[2]);
		t += Math.abs(A[0] - A[1]);
		ans = Math.min(ans, t);




		System.out.println(ans);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int []A = new int[3];
		for(int i = 0; i < 3; i++) {
			A[i] = scan.nextInt();
		}
		scan.close();
		int ans = 0;

		// 0
		int t = Math.abs(A[1] - A[0]);
		t += Math.abs(A[2] - A[1]);
		ans = t;

		t = Math.abs(A[2] - A[0]);
		t += Math.abs(A[1] - A[2]);
		ans = Math.min(ans, t);

		// 1
		t = Math.abs(A[0] - A[1]);
		t += Math.abs(A[2] - A[0]);
		ans = Math.min(ans, t);

		t = Math.abs(A[2] - A[1]);
		t += Math.abs(A[0] - A[2]);
		ans = Math.min(ans, t);

		// 2
		t = Math.abs(A[0] - A[2]);
		t += Math.abs(A[1] - A[0]);
		ans = Math.min(ans, t);

		t = Math.abs(A[1] - A[2]);
		t += Math.abs(A[0] - A[1]);
		ans = Math.min(ans, t);




		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int []A = new int[3];
		for(int i = 0; i < 3; i++) {
			A[i] = scan.nextInt();
		}
		scan.close();
		int ans = 0;

		// 0
		int t = Math.abs(A[1] - A[0]);
		t += Math.abs(A[2] - A[1]);
		ans = t;

		t = Math.abs(A[2] - A[0]);
		t += Math.abs(A[1] - A[2]);
		ans = Math.min(ans, t);

		// 1
		t = Math.abs(A[0] - A[1]);
		t += Math.abs(A[2] - A[0]);
		ans = Math.min(ans, t);

		t = Math.abs(A[2] - A[1]);
		t += Math.abs(A[0] - A[2]);
		ans = Math.min(ans, t);

		// 2
		t = Math.abs(A[0] - A[2]);
		t += Math.abs(A[1] - A[0]);
		ans = Math.min(ans, t);

		t = Math.abs(A[1] - A[2]);
		t += Math.abs(A[0] - A[1]);
		ans = Math.min(ans, t);




		System.out.println(ans);
	} main {
		Scanner scan = new Scanner(System.in);
		int []A = new int[3];
		for(int i = 0; i < 3; i++) {
			A[i] = scan.nextInt();
		}
		scan.close();
		int ans = 0;

		// 0
		int t = Math.abs(A[1] - A[0]);
		t += Math.abs(A[2] - A[1]);
		ans = t;

		t = Math.abs(A[2] - A[0]);
		t += Math.abs(A[1] - A[2]);
		ans = Math.min(ans, t);

		// 1
		t = Math.abs(A[0] - A[1]);
		t += Math.abs(A[2] - A[0]);
		ans = Math.min(ans, t);

		t = Math.abs(A[2] - A[1]);
		t += Math.abs(A[0] - A[2]);
		ans = Math.min(ans, t);

		// 2
		t = Math.abs(A[0] - A[2]);
		t += Math.abs(A[1] - A[0]);
		ans = Math.min(ans, t);

		t = Math.abs(A[1] - A[2]);
		t += Math.abs(A[0] - A[1]);
		ans = Math.min(ans, t);




		System.out.println(ans);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int []A = new int[3]; A new int[3] 3 for(int i = 0; i < 3; i++) {
			A[i] = scan.nextInt();
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			A[i] = scan.nextInt();
		} {
			A[i] = scan.nextInt();
		} A[i] = scan.nextInt() A[i] A i scan.nextInt() scan.nextInt scan scan.close() scan.close scan int ans = 0; ans 0 int t = Math.abs(A[1] - A[0]); t Math.abs(A[1] - A[0]) Math.abs Math A[1] - A[0] A[1] A 1 A[0] A 0 t += Math.abs(A[2] - A[1]) t Math.abs(A[2] - A[1]) Math.abs Math A[2] - A[1] A[2] A 2 A[1] A 1 ans = t ans t t = Math.abs(A[2] - A[0]) t Math.abs(A[2] - A[0]) Math.abs Math A[2] - A[0] A[2] A 2 A[0] A 0 t += Math.abs(A[1] - A[2]) t Math.abs(A[1] - A[2]) Math.abs Math A[1] - A[2] A[1] A 1 A[2] A 2 ans = Math.min(ans, t) ans Math.min(ans, t) Math.min Math ans t t = Math.abs(A[0] - A[1]) t Math.abs(A[0] - A[1]) Math.abs Math A[0] - A[1] A[0] A 0 A[1] A 1 t += Math.abs(A[2] - A[0]) t Math.abs(A[2] - A[0]) Math.abs Math A[2] - A[0] A[2] A 2 A[0] A 0 ans = Math.min(ans, t) ans Math.min(ans, t) Math.min Math ans t t = Math.abs(A[2] - A[1]) t Math.abs(A[2] - A[1]) Math.abs Math A[2] - A[1] A[2] A 2 A[1] A 1 t += Math.abs(A[0] - A[2]) t Math.abs(A[0] - A[2]) Math.abs Math A[0] - A[2] A[0] A 0 A[2] A 2 ans = Math.min(ans, t) ans Math.min(ans, t) Math.min Math ans t t = Math.abs(A[0] - A[2]) t Math.abs(A[0] - A[2]) Math.abs Math A[0] - A[2] A[0] A 0 A[2] A 2 t += Math.abs(A[1] - A[0]) t Math.abs(A[1] - A[0]) Math.abs Math A[1] - A[0] A[1] A 1 A[0] A 0 ans = Math.min(ans, t) ans Math.min(ans, t) Math.min Math ans t t = Math.abs(A[1] - A[2]) t Math.abs(A[1] - A[2]) Math.abs Math A[1] - A[2] A[1] A 1 A[2] A 2 t += Math.abs(A[0] - A[1]) t Math.abs(A[0] - A[1]) Math.abs Math A[0] - A[1] A[0] A 0 A[1] A 1 ans = Math.min(ans, t) ans Math.min(ans, t) Math.min Math ans t System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int []A = new int[3];
		for(int i = 0; i < 3; i++) {
			A[i] = scan.nextInt();
		}
		scan.close();
		int ans = 0;

		// 0
		int t = Math.abs(A[1] - A[0]);
		t += Math.abs(A[2] - A[1]);
		ans = t;

		t = Math.abs(A[2] - A[0]);
		t += Math.abs(A[1] - A[2]);
		ans = Math.min(ans, t);

		// 1
		t = Math.abs(A[0] - A[1]);
		t += Math.abs(A[2] - A[0]);
		ans = Math.min(ans, t);

		t = Math.abs(A[2] - A[1]);
		t += Math.abs(A[0] - A[2]);
		ans = Math.min(ans, t);

		// 2
		t = Math.abs(A[0] - A[2]);
		t += Math.abs(A[1] - A[0]);
		ans = Math.min(ans, t);

		t = Math.abs(A[1] - A[2]);
		t += Math.abs(A[0] - A[1]);
		ans = Math.min(ans, t);




		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int []A = new int[3];
		for(int i = 0; i < 3; i++) {
			A[i] = scan.nextInt();
		}
		scan.close();
		int ans = 0;

		// 0
		int t = Math.abs(A[1] - A[0]);
		t += Math.abs(A[2] - A[1]);
		ans = t;

		t = Math.abs(A[2] - A[0]);
		t += Math.abs(A[1] - A[2]);
		ans = Math.min(ans, t);

		// 1
		t = Math.abs(A[0] - A[1]);
		t += Math.abs(A[2] - A[0]);
		ans = Math.min(ans, t);

		t = Math.abs(A[2] - A[1]);
		t += Math.abs(A[0] - A[2]);
		ans = Math.min(ans, t);

		// 2
		t = Math.abs(A[0] - A[2]);
		t += Math.abs(A[1] - A[0]);
		ans = Math.min(ans, t);

		t = Math.abs(A[1] - A[2]);
		t += Math.abs(A[0] - A[1]);
		ans = Math.min(ans, t);




		System.out.println(ans);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int []A = new int[3];
		for(int i = 0; i < 3; i++) {
			A[i] = scan.nextInt();
		}
		scan.close();
		int ans = 0;

		// 0
		int t = Math.abs(A[1] - A[0]);
		t += Math.abs(A[2] - A[1]);
		ans = t;

		t = Math.abs(A[2] - A[0]);
		t += Math.abs(A[1] - A[2]);
		ans = Math.min(ans, t);

		// 1
		t = Math.abs(A[0] - A[1]);
		t += Math.abs(A[2] - A[0]);
		ans = Math.min(ans, t);

		t = Math.abs(A[2] - A[1]);
		t += Math.abs(A[0] - A[2]);
		ans = Math.min(ans, t);

		// 2
		t = Math.abs(A[0] - A[2]);
		t += Math.abs(A[1] - A[0]);
		ans = Math.min(ans, t);

		t = Math.abs(A[1] - A[2]);
		t += Math.abs(A[0] - A[1]);
		ans = Math.min(ans, t);




		System.out.println(ans);
	}
}