import java.util.Scanner;

public class Main {

	public static int Compraison(int a, int b) {

		if (a < b)
			return a;
		else
			return b;
	}

	public static int TaskCalc(int a, int b, int c) {

		int sum = 0;

		sum += Math.abs(b - a);
		sum += Math.abs(c - b);

		return sum;
	}

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();

		int cost;

		cost = TaskCalc(a, b, c);
		cost = Compraison(cost, TaskCalc(a, c, b));
		cost = Compraison(cost, TaskCalc(b, a, c));
		cost = Compraison(cost, TaskCalc(b, c, a));
		cost = Compraison(cost, TaskCalc(c, a, b));
		cost = Compraison(cost, TaskCalc(c, b, a));

		System.out.println(cost);

		sc.close();
	}

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

	public static int Compraison(int a, int b) {

		if (a < b)
			return a;
		else
			return b;
	}

	public static int TaskCalc(int a, int b, int c) {

		int sum = 0;

		sum += Math.abs(b - a);
		sum += Math.abs(c - b);

		return sum;
	}

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();

		int cost;

		cost = TaskCalc(a, b, c);
		cost = Compraison(cost, TaskCalc(a, c, b));
		cost = Compraison(cost, TaskCalc(b, a, c));
		cost = Compraison(cost, TaskCalc(b, c, a));
		cost = Compraison(cost, TaskCalc(c, a, b));
		cost = Compraison(cost, TaskCalc(c, b, a));

		System.out.println(cost);

		sc.close();
	}

} Main public static int Compraison(int a, int b) {

		if (a < b)
			return a;
		else
			return b;
	} Compraison {

		if (a < b)
			return a;
		else
			return b;
	} if (a < b)
			return a;
		else
			return b; a < b a b return a; a return b; b int a a int b b public static int TaskCalc(int a, int b, int c) {

		int sum = 0;

		sum += Math.abs(b - a);
		sum += Math.abs(c - b);

		return sum;
	} TaskCalc {

		int sum = 0;

		sum += Math.abs(b - a);
		sum += Math.abs(c - b);

		return sum;
	} int sum = 0; sum 0 sum += Math.abs(b - a) sum Math.abs(b - a) Math.abs Math b - a b a sum += Math.abs(c - b) sum Math.abs(c - b) Math.abs Math c - b c b return sum; sum int a a int b b int c c public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();

		int cost;

		cost = TaskCalc(a, b, c);
		cost = Compraison(cost, TaskCalc(a, c, b));
		cost = Compraison(cost, TaskCalc(b, a, c));
		cost = Compraison(cost, TaskCalc(b, c, a));
		cost = Compraison(cost, TaskCalc(c, a, b));
		cost = Compraison(cost, TaskCalc(c, b, a));

		System.out.println(cost);

		sc.close();
	} main {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();

		int cost;

		cost = TaskCalc(a, b, c);
		cost = Compraison(cost, TaskCalc(a, c, b));
		cost = Compraison(cost, TaskCalc(b, a, c));
		cost = Compraison(cost, TaskCalc(b, c, a));
		cost = Compraison(cost, TaskCalc(c, a, b));
		cost = Compraison(cost, TaskCalc(c, b, a));

		System.out.println(cost);

		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc int cost; cost cost = TaskCalc(a, b, c) cost TaskCalc(a, b, c) TaskCalc a b c cost = Compraison(cost, TaskCalc(a, c, b)) cost Compraison(cost, TaskCalc(a, c, b)) Compraison cost TaskCalc(a, c, b) TaskCalc a c b cost = Compraison(cost, TaskCalc(b, a, c)) cost Compraison(cost, TaskCalc(b, a, c)) Compraison cost TaskCalc(b, a, c) TaskCalc b a c cost = Compraison(cost, TaskCalc(b, c, a)) cost Compraison(cost, TaskCalc(b, c, a)) Compraison cost TaskCalc(b, c, a) TaskCalc b c a cost = Compraison(cost, TaskCalc(c, a, b)) cost Compraison(cost, TaskCalc(c, a, b)) Compraison cost TaskCalc(c, a, b) TaskCalc c a b cost = Compraison(cost, TaskCalc(c, b, a)) cost Compraison(cost, TaskCalc(c, b, a)) Compraison cost TaskCalc(c, b, a) TaskCalc c b a System.out.println(cost) System.out.println System.out System System.out cost sc.close() sc.close sc String[] args args public class Main {

	public static int Compraison(int a, int b) {

		if (a < b)
			return a;
		else
			return b;
	}

	public static int TaskCalc(int a, int b, int c) {

		int sum = 0;

		sum += Math.abs(b - a);
		sum += Math.abs(c - b);

		return sum;
	}

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();

		int cost;

		cost = TaskCalc(a, b, c);
		cost = Compraison(cost, TaskCalc(a, c, b));
		cost = Compraison(cost, TaskCalc(b, a, c));
		cost = Compraison(cost, TaskCalc(b, c, a));
		cost = Compraison(cost, TaskCalc(c, a, b));
		cost = Compraison(cost, TaskCalc(c, b, a));

		System.out.println(cost);

		sc.close();
	}

} public class Main {

	public static int Compraison(int a, int b) {

		if (a < b)
			return a;
		else
			return b;
	}

	public static int TaskCalc(int a, int b, int c) {

		int sum = 0;

		sum += Math.abs(b - a);
		sum += Math.abs(c - b);

		return sum;
	}

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();

		int cost;

		cost = TaskCalc(a, b, c);
		cost = Compraison(cost, TaskCalc(a, c, b));
		cost = Compraison(cost, TaskCalc(b, a, c));
		cost = Compraison(cost, TaskCalc(b, c, a));
		cost = Compraison(cost, TaskCalc(c, a, b));
		cost = Compraison(cost, TaskCalc(c, b, a));

		System.out.println(cost);

		sc.close();
	}

} Main
import java.util.Scanner;

public class Main {

	public static int Compraison(int a, int b) {

		if (a < b)
			return a;
		else
			return b;
	}

	public static int TaskCalc(int a, int b, int c) {

		int sum = 0;

		sum += Math.abs(b - a);
		sum += Math.abs(c - b);

		return sum;
	}

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();

		int cost;

		cost = TaskCalc(a, b, c);
		cost = Compraison(cost, TaskCalc(a, c, b));
		cost = Compraison(cost, TaskCalc(b, a, c));
		cost = Compraison(cost, TaskCalc(b, c, a));
		cost = Compraison(cost, TaskCalc(c, a, b));
		cost = Compraison(cost, TaskCalc(c, b, a));

		System.out.println(cost);

		sc.close();
	}

}
