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

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A[] = new int[3];

		for (int i = 0; i < 3; i++) {
			A[i] = sc.nextInt();
		}

		Arrays.sort(A);

		int tmp = A[2] - A[1];
		tmp = tmp + (A[1] - A[0]);

		System.out.println(tmp < 0? "0": tmp);

	}
} 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 A[] = new int[3];

		for (int i = 0; i < 3; i++) {
			A[i] = sc.nextInt();
		}

		Arrays.sort(A);

		int tmp = A[2] - A[1];
		tmp = tmp + (A[1] - A[0]);

		System.out.println(tmp < 0? "0": tmp);

	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A[] = new int[3];

		for (int i = 0; i < 3; i++) {
			A[i] = sc.nextInt();
		}

		Arrays.sort(A);

		int tmp = A[2] - A[1];
		tmp = tmp + (A[1] - A[0]);

		System.out.println(tmp < 0? "0": tmp);

	} main {
		Scanner sc = new Scanner(System.in);
		int A[] = new int[3];

		for (int i = 0; i < 3; i++) {
			A[i] = sc.nextInt();
		}

		Arrays.sort(A);

		int tmp = A[2] - A[1];
		tmp = tmp + (A[1] - A[0]);

		System.out.println(tmp < 0? "0": tmp);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A[] = new int[3]; A new int[3] 3 for (int i = 0; i < 3; i++) {
			A[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			A[i] = sc.nextInt();
		} {
			A[i] = sc.nextInt();
		} A[i] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc Arrays.sort(A) Arrays.sort Arrays A int tmp = A[2] - A[1]; tmp A[2] - A[1] A[2] A 2 A[1] A 1 tmp = tmp + (A[1] - A[0]) tmp tmp + (A[1] - A[0]) tmp (A[1] - A[0]) A[1] A 1 A[0] A 0 System.out.println(tmp < 0? "0": tmp) System.out.println System.out System System.out tmp < 0? "0": tmp tmp < 0 tmp 0 "0" tmp String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A[] = new int[3];

		for (int i = 0; i < 3; i++) {
			A[i] = sc.nextInt();
		}

		Arrays.sort(A);

		int tmp = A[2] - A[1];
		tmp = tmp + (A[1] - A[0]);

		System.out.println(tmp < 0? "0": tmp);

	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A[] = new int[3];

		for (int i = 0; i < 3; i++) {
			A[i] = sc.nextInt();
		}

		Arrays.sort(A);

		int tmp = A[2] - A[1];
		tmp = tmp + (A[1] - A[0]);

		System.out.println(tmp < 0? "0": tmp);

	}
} 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 A[] = new int[3];

		for (int i = 0; i < 3; i++) {
			A[i] = sc.nextInt();
		}

		Arrays.sort(A);

		int tmp = A[2] - A[1];
		tmp = tmp + (A[1] - A[0]);

		System.out.println(tmp < 0? "0": tmp);

	}
}
