import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int A = reader.nextInt();
		int B = reader.nextInt();
		int C = reader.nextInt();
		int[] gaps = new int[6];

		gaps[0] = Math.abs(A - B) + Math.abs(B - C);
		gaps[1] = Math.abs(A - C) + Math.abs(C - B);
		gaps[2] = Math.abs(B - A) + Math.abs(A - C);
		gaps[3] = Math.abs(B - C) + Math.abs(C - A);
		gaps[4] = Math.abs(C - A) + Math.abs(A - B);
		gaps[5] = Math.abs(C - B) + Math.abs(B - A);

		int min = gaps[0];
		for (int i = 1; i < 6; i++) {
			if (gaps[i] < min) {
				min = gaps[i];
			}
		}

		reader.close();
		System.out.print(min);
	}
}
 import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int A = reader.nextInt();
		int B = reader.nextInt();
		int C = reader.nextInt();
		int[] gaps = new int[6];

		gaps[0] = Math.abs(A - B) + Math.abs(B - C);
		gaps[1] = Math.abs(A - C) + Math.abs(C - B);
		gaps[2] = Math.abs(B - A) + Math.abs(A - C);
		gaps[3] = Math.abs(B - C) + Math.abs(C - A);
		gaps[4] = Math.abs(C - A) + Math.abs(A - B);
		gaps[5] = Math.abs(C - B) + Math.abs(B - A);

		int min = gaps[0];
		for (int i = 1; i < 6; i++) {
			if (gaps[i] < min) {
				min = gaps[i];
			}
		}

		reader.close();
		System.out.print(min);
	}
} Main public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int A = reader.nextInt();
		int B = reader.nextInt();
		int C = reader.nextInt();
		int[] gaps = new int[6];

		gaps[0] = Math.abs(A - B) + Math.abs(B - C);
		gaps[1] = Math.abs(A - C) + Math.abs(C - B);
		gaps[2] = Math.abs(B - A) + Math.abs(A - C);
		gaps[3] = Math.abs(B - C) + Math.abs(C - A);
		gaps[4] = Math.abs(C - A) + Math.abs(A - B);
		gaps[5] = Math.abs(C - B) + Math.abs(B - A);

		int min = gaps[0];
		for (int i = 1; i < 6; i++) {
			if (gaps[i] < min) {
				min = gaps[i];
			}
		}

		reader.close();
		System.out.print(min);
	} main {
		Scanner reader = new Scanner(System.in);
		int A = reader.nextInt();
		int B = reader.nextInt();
		int C = reader.nextInt();
		int[] gaps = new int[6];

		gaps[0] = Math.abs(A - B) + Math.abs(B - C);
		gaps[1] = Math.abs(A - C) + Math.abs(C - B);
		gaps[2] = Math.abs(B - A) + Math.abs(A - C);
		gaps[3] = Math.abs(B - C) + Math.abs(C - A);
		gaps[4] = Math.abs(C - A) + Math.abs(A - B);
		gaps[5] = Math.abs(C - B) + Math.abs(B - A);

		int min = gaps[0];
		for (int i = 1; i < 6; i++) {
			if (gaps[i] < min) {
				min = gaps[i];
			}
		}

		reader.close();
		System.out.print(min);
	} Scanner reader = new Scanner(System.in); reader new Scanner(System.in) int A = reader.nextInt(); A reader.nextInt() reader.nextInt reader int B = reader.nextInt(); B reader.nextInt() reader.nextInt reader int C = reader.nextInt(); C reader.nextInt() reader.nextInt reader int[] gaps = new int[6]; gaps new int[6] 6 gaps[0] = Math.abs(A - B) + Math.abs(B - C) gaps[0] gaps 0 Math.abs(A - B) + Math.abs(B - C) Math.abs(A - B) Math.abs Math A - B A B Math.abs(B - C) Math.abs Math B - C B C gaps[1] = Math.abs(A - C) + Math.abs(C - B) gaps[1] gaps 1 Math.abs(A - C) + Math.abs(C - B) Math.abs(A - C) Math.abs Math A - C A C Math.abs(C - B) Math.abs Math C - B C B gaps[2] = Math.abs(B - A) + Math.abs(A - C) gaps[2] gaps 2 Math.abs(B - A) + Math.abs(A - C) Math.abs(B - A) Math.abs Math B - A B A Math.abs(A - C) Math.abs Math A - C A C gaps[3] = Math.abs(B - C) + Math.abs(C - A) gaps[3] gaps 3 Math.abs(B - C) + Math.abs(C - A) Math.abs(B - C) Math.abs Math B - C B C Math.abs(C - A) Math.abs Math C - A C A gaps[4] = Math.abs(C - A) + Math.abs(A - B) gaps[4] gaps 4 Math.abs(C - A) + Math.abs(A - B) Math.abs(C - A) Math.abs Math C - A C A Math.abs(A - B) Math.abs Math A - B A B gaps[5] = Math.abs(C - B) + Math.abs(B - A) gaps[5] gaps 5 Math.abs(C - B) + Math.abs(B - A) Math.abs(C - B) Math.abs Math C - B C B Math.abs(B - A) Math.abs Math B - A B A int min = gaps[0]; min gaps[0] gaps 0 for (int i = 1; i < 6; i++) {
			if (gaps[i] < min) {
				min = gaps[i];
			}
		} int i = 1; int i = 1; i 1 i < 6 i 6 i++ i++ i {
			if (gaps[i] < min) {
				min = gaps[i];
			}
		} {
			if (gaps[i] < min) {
				min = gaps[i];
			}
		} if (gaps[i] < min) {
				min = gaps[i];
			} gaps[i] < min gaps[i] gaps i min {
				min = gaps[i];
			} min = gaps[i] min gaps[i] gaps i reader.close() reader.close reader System.out.print(min) System.out.print System.out System System.out min String[] args args public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int A = reader.nextInt();
		int B = reader.nextInt();
		int C = reader.nextInt();
		int[] gaps = new int[6];

		gaps[0] = Math.abs(A - B) + Math.abs(B - C);
		gaps[1] = Math.abs(A - C) + Math.abs(C - B);
		gaps[2] = Math.abs(B - A) + Math.abs(A - C);
		gaps[3] = Math.abs(B - C) + Math.abs(C - A);
		gaps[4] = Math.abs(C - A) + Math.abs(A - B);
		gaps[5] = Math.abs(C - B) + Math.abs(B - A);

		int min = gaps[0];
		for (int i = 1; i < 6; i++) {
			if (gaps[i] < min) {
				min = gaps[i];
			}
		}

		reader.close();
		System.out.print(min);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int A = reader.nextInt();
		int B = reader.nextInt();
		int C = reader.nextInt();
		int[] gaps = new int[6];

		gaps[0] = Math.abs(A - B) + Math.abs(B - C);
		gaps[1] = Math.abs(A - C) + Math.abs(C - B);
		gaps[2] = Math.abs(B - A) + Math.abs(A - C);
		gaps[3] = Math.abs(B - C) + Math.abs(C - A);
		gaps[4] = Math.abs(C - A) + Math.abs(A - B);
		gaps[5] = Math.abs(C - B) + Math.abs(B - A);

		int min = gaps[0];
		for (int i = 1; i < 6; i++) {
			if (gaps[i] < min) {
				min = gaps[i];
			}
		}

		reader.close();
		System.out.print(min);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int A = reader.nextInt();
		int B = reader.nextInt();
		int C = reader.nextInt();
		int[] gaps = new int[6];

		gaps[0] = Math.abs(A - B) + Math.abs(B - C);
		gaps[1] = Math.abs(A - C) + Math.abs(C - B);
		gaps[2] = Math.abs(B - A) + Math.abs(A - C);
		gaps[3] = Math.abs(B - C) + Math.abs(C - A);
		gaps[4] = Math.abs(C - A) + Math.abs(A - B);
		gaps[5] = Math.abs(C - B) + Math.abs(B - A);

		int min = gaps[0];
		for (int i = 1; i < 6; i++) {
			if (gaps[i] < min) {
				min = gaps[i];
			}
		}

		reader.close();
		System.out.print(min);
	}
}

