import java.util.*;
class Main{
	public static void main(String[] args1) {
		Scanner s = new Scanner(System.in);
		String line = s.nextLine();
		String[] args = line.split(" ");
		int[] arr = new int[args.length];
		for(int i = 0;i < args.length;i++)
			arr[i] =  Integer.parseInt(args[i]);

		int count = 0;
		Arrays.sort(arr);
		for(int i = 0;i < arr.length-1;i++)
			count += Math.abs(arr[i] - arr[i+1]);

		System.out.println(count);


	}
} import java.util.*; util.* java class Main{
	public static void main(String[] args1) {
		Scanner s = new Scanner(System.in);
		String line = s.nextLine();
		String[] args = line.split(" ");
		int[] arr = new int[args.length];
		for(int i = 0;i < args.length;i++)
			arr[i] =  Integer.parseInt(args[i]);

		int count = 0;
		Arrays.sort(arr);
		for(int i = 0;i < arr.length-1;i++)
			count += Math.abs(arr[i] - arr[i+1]);

		System.out.println(count);


	}
} Main public static void main(String[] args1) {
		Scanner s = new Scanner(System.in);
		String line = s.nextLine();
		String[] args = line.split(" ");
		int[] arr = new int[args.length];
		for(int i = 0;i < args.length;i++)
			arr[i] =  Integer.parseInt(args[i]);

		int count = 0;
		Arrays.sort(arr);
		for(int i = 0;i < arr.length-1;i++)
			count += Math.abs(arr[i] - arr[i+1]);

		System.out.println(count);


	} main {
		Scanner s = new Scanner(System.in);
		String line = s.nextLine();
		String[] args = line.split(" ");
		int[] arr = new int[args.length];
		for(int i = 0;i < args.length;i++)
			arr[i] =  Integer.parseInt(args[i]);

		int count = 0;
		Arrays.sort(arr);
		for(int i = 0;i < arr.length-1;i++)
			count += Math.abs(arr[i] - arr[i+1]);

		System.out.println(count);


	} Scanner s = new Scanner(System.in); s new Scanner(System.in) String line = s.nextLine(); line s.nextLine() s.nextLine s String[] args = line.split(" "); args line.split(" ") line.split line " " int[] arr = new int[args.length]; arr new int[args.length] args.length args args.length for(int i = 0;i < args.length;i++)
			arr[i] =  Integer.parseInt(args[i]); int i = 0; int i = 0; i 0 i < args.length i args.length args args.length i++ i++ i arr[i] =  Integer.parseInt(args[i]); arr[i] =  Integer.parseInt(args[i]) arr[i] arr i Integer.parseInt(args[i]) Integer.parseInt Integer args[i] args i int count = 0; count 0 Arrays.sort(arr) Arrays.sort Arrays arr for(int i = 0;i < arr.length-1;i++)
			count += Math.abs(arr[i] - arr[i+1]); int i = 0; int i = 0; i 0 i < arr.length-1 i arr.length-1 arr.length arr arr.length 1 i++ i++ i count += Math.abs(arr[i] - arr[i+1]); count += Math.abs(arr[i] - arr[i+1]) count Math.abs(arr[i] - arr[i+1]) Math.abs Math arr[i] - arr[i+1] arr[i] arr i arr[i+1] arr i+1 i 1 System.out.println(count) System.out.println System.out System System.out count String[] args1 args1
import java.util.*;
class Main{
	public static void main(String[] args1) {
		Scanner s = new Scanner(System.in);
		String line = s.nextLine();
		String[] args = line.split(" ");
		int[] arr = new int[args.length];
		for(int i = 0;i < args.length;i++)
			arr[i] =  Integer.parseInt(args[i]);

		int count = 0;
		Arrays.sort(arr);
		for(int i = 0;i < arr.length-1;i++)
			count += Math.abs(arr[i] - arr[i+1]);

		System.out.println(count);


	}
}