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] = Integer.parseInt(sc.next());
		}
		Arrays.sort(a);

		int cost = 0;
		for (int i = 0; i < 3; i++) {
			if (i != 0) {
				cost += a[i] - a[i - 1];
			}
		}

		System.out.println(cost);

	}

} 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] = Integer.parseInt(sc.next());
		}
		Arrays.sort(a);

		int cost = 0;
		for (int i = 0; i < 3; i++) {
			if (i != 0) {
				cost += a[i] - a[i - 1];
			}
		}

		System.out.println(cost);

	}

} 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] = Integer.parseInt(sc.next());
		}
		Arrays.sort(a);

		int cost = 0;
		for (int i = 0; i < 3; i++) {
			if (i != 0) {
				cost += a[i] - a[i - 1];
			}
		}

		System.out.println(cost);

	} main {
		Scanner sc = new Scanner(System.in);
		int[] a = new int[3];
		for (int i = 0; i < 3; i++) {
			a[i] = Integer.parseInt(sc.next());
		}
		Arrays.sort(a);

		int cost = 0;
		for (int i = 0; i < 3; i++) {
			if (i != 0) {
				cost += a[i] - a[i - 1];
			}
		}

		System.out.println(cost);

	} 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] = Integer.parseInt(sc.next());
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			a[i] = Integer.parseInt(sc.next());
		} {
			a[i] = Integer.parseInt(sc.next());
		} a[i] = Integer.parseInt(sc.next()) a[i] a i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Arrays.sort(a) Arrays.sort Arrays a int cost = 0; cost 0 for (int i = 0; i < 3; i++) {
			if (i != 0) {
				cost += a[i] - a[i - 1];
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			if (i != 0) {
				cost += a[i] - a[i - 1];
			}
		} {
			if (i != 0) {
				cost += a[i] - a[i - 1];
			}
		} if (i != 0) {
				cost += a[i] - a[i - 1];
			} i != 0 i 0 {
				cost += a[i] - a[i - 1];
			} cost += a[i] - a[i - 1] cost a[i] - a[i - 1] a[i] a i a[i - 1] a i - 1 i 1 System.out.println(cost) System.out.println System.out System System.out cost 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] = Integer.parseInt(sc.next());
		}
		Arrays.sort(a);

		int cost = 0;
		for (int i = 0; i < 3; i++) {
			if (i != 0) {
				cost += a[i] - a[i - 1];
			}
		}

		System.out.println(cost);

	}

} 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] = Integer.parseInt(sc.next());
		}
		Arrays.sort(a);

		int cost = 0;
		for (int i = 0; i < 3; i++) {
			if (i != 0) {
				cost += a[i] - a[i - 1];
			}
		}

		System.out.println(cost);

	}

} 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] = Integer.parseInt(sc.next());
		}
		Arrays.sort(a);

		int cost = 0;
		for (int i = 0; i < 3; i++) {
			if (i != 0) {
				cost += a[i] - a[i - 1];
			}
		}

		System.out.println(cost);

	}

}
