import java.util.*;
public class Main
{
	public static void main(String[] args) 
	{
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		char arr[] = new char[s.length()];
		arr = s.toCharArray();
		for(int i=0;i<s.length();i++)
		{
			if(arr[i]==' ')
				arr[i]=',';
		}
		String ss = new String(arr);
		// System.out.println(ss);
		// int n = sc.nextInt();
		// System.out.println(0);
		// String s = sc.next();
		String sarr[] = ss.split(",");
		int aarr[] = new int[sarr.length];
		// sarr[] = ;
		// System.out.println("fghj");
		for(int i=0;i<sarr.length;i++)
			aarr[i]=Integer.parseInt(sarr[i]);
		Arrays.sort(aarr);
		
		int count = 0;
		for(int i=sarr.length - 1;i>0;i--)
			count+= aarr[i]-aarr[i-1];

		System.out.println(count);
	}
} import java.util.*; util.* java public class Main
{
	public static void main(String[] args) 
	{
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		char arr[] = new char[s.length()];
		arr = s.toCharArray();
		for(int i=0;i<s.length();i++)
		{
			if(arr[i]==' ')
				arr[i]=',';
		}
		String ss = new String(arr);
		// System.out.println(ss);
		// int n = sc.nextInt();
		// System.out.println(0);
		// String s = sc.next();
		String sarr[] = ss.split(",");
		int aarr[] = new int[sarr.length];
		// sarr[] = ;
		// System.out.println("fghj");
		for(int i=0;i<sarr.length;i++)
			aarr[i]=Integer.parseInt(sarr[i]);
		Arrays.sort(aarr);
		
		int count = 0;
		for(int i=sarr.length - 1;i>0;i--)
			count+= aarr[i]-aarr[i-1];

		System.out.println(count);
	}
} Main public static void main(String[] args) 
	{
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		char arr[] = new char[s.length()];
		arr = s.toCharArray();
		for(int i=0;i<s.length();i++)
		{
			if(arr[i]==' ')
				arr[i]=',';
		}
		String ss = new String(arr);
		// System.out.println(ss);
		// int n = sc.nextInt();
		// System.out.println(0);
		// String s = sc.next();
		String sarr[] = ss.split(",");
		int aarr[] = new int[sarr.length];
		// sarr[] = ;
		// System.out.println("fghj");
		for(int i=0;i<sarr.length;i++)
			aarr[i]=Integer.parseInt(sarr[i]);
		Arrays.sort(aarr);
		
		int count = 0;
		for(int i=sarr.length - 1;i>0;i--)
			count+= aarr[i]-aarr[i-1];

		System.out.println(count);
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		char arr[] = new char[s.length()];
		arr = s.toCharArray();
		for(int i=0;i<s.length();i++)
		{
			if(arr[i]==' ')
				arr[i]=',';
		}
		String ss = new String(arr);
		// System.out.println(ss);
		// int n = sc.nextInt();
		// System.out.println(0);
		// String s = sc.next();
		String sarr[] = ss.split(",");
		int aarr[] = new int[sarr.length];
		// sarr[] = ;
		// System.out.println("fghj");
		for(int i=0;i<sarr.length;i++)
			aarr[i]=Integer.parseInt(sarr[i]);
		Arrays.sort(aarr);
		
		int count = 0;
		for(int i=sarr.length - 1;i>0;i--)
			count+= aarr[i]-aarr[i-1];

		System.out.println(count);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc char arr[] = new char[s.length()]; arr new char[s.length()] s.length() s.length s arr = s.toCharArray() arr s.toCharArray() s.toCharArray s for(int i=0;i<s.length();i++)
		{
			if(arr[i]==' ')
				arr[i]=',';
		} int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
			if(arr[i]==' ')
				arr[i]=',';
		} {
			if(arr[i]==' ')
				arr[i]=',';
		} if(arr[i]==' ')
				arr[i]=','; arr[i]==' ' arr[i] arr i ' ' arr[i]=',' arr[i] arr i ',' String ss = new String(arr); ss new String(arr) String sarr[] = ss.split(","); sarr ss.split(",") ss.split ss "," int aarr[] = new int[sarr.length]; aarr new int[sarr.length] sarr.length sarr sarr.length for(int i=0;i<sarr.length;i++)
			aarr[i]=Integer.parseInt(sarr[i]); int i=0; int i=0; i 0 i<sarr.length i sarr.length sarr sarr.length i++ i++ i aarr[i]=Integer.parseInt(sarr[i]); aarr[i]=Integer.parseInt(sarr[i]) aarr[i] aarr i Integer.parseInt(sarr[i]) Integer.parseInt Integer sarr[i] sarr i Arrays.sort(aarr) Arrays.sort Arrays aarr int count = 0; count 0 for(int i=sarr.length - 1;i>0;i--)
			count+= aarr[i]-aarr[i-1]; int i=sarr.length - 1; int i=sarr.length - 1; i sarr.length - 1 sarr.length sarr sarr.length 1 i>0 i 0 i-- i-- i count+= aarr[i]-aarr[i-1]; count+= aarr[i]-aarr[i-1] count aarr[i]-aarr[i-1] aarr[i] aarr i aarr[i-1] aarr i-1 i 1 System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main
{
	public static void main(String[] args) 
	{
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		char arr[] = new char[s.length()];
		arr = s.toCharArray();
		for(int i=0;i<s.length();i++)
		{
			if(arr[i]==' ')
				arr[i]=',';
		}
		String ss = new String(arr);
		// System.out.println(ss);
		// int n = sc.nextInt();
		// System.out.println(0);
		// String s = sc.next();
		String sarr[] = ss.split(",");
		int aarr[] = new int[sarr.length];
		// sarr[] = ;
		// System.out.println("fghj");
		for(int i=0;i<sarr.length;i++)
			aarr[i]=Integer.parseInt(sarr[i]);
		Arrays.sort(aarr);
		
		int count = 0;
		for(int i=sarr.length - 1;i>0;i--)
			count+= aarr[i]-aarr[i-1];

		System.out.println(count);
	}
} public class Main
{
	public static void main(String[] args) 
	{
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		char arr[] = new char[s.length()];
		arr = s.toCharArray();
		for(int i=0;i<s.length();i++)
		{
			if(arr[i]==' ')
				arr[i]=',';
		}
		String ss = new String(arr);
		// System.out.println(ss);
		// int n = sc.nextInt();
		// System.out.println(0);
		// String s = sc.next();
		String sarr[] = ss.split(",");
		int aarr[] = new int[sarr.length];
		// sarr[] = ;
		// System.out.println("fghj");
		for(int i=0;i<sarr.length;i++)
			aarr[i]=Integer.parseInt(sarr[i]);
		Arrays.sort(aarr);
		
		int count = 0;
		for(int i=sarr.length - 1;i>0;i--)
			count+= aarr[i]-aarr[i-1];

		System.out.println(count);
	}
} Main
import java.util.*;
public class Main
{
	public static void main(String[] args) 
	{
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		char arr[] = new char[s.length()];
		arr = s.toCharArray();
		for(int i=0;i<s.length();i++)
		{
			if(arr[i]==' ')
				arr[i]=',';
		}
		String ss = new String(arr);
		// System.out.println(ss);
		// int n = sc.nextInt();
		// System.out.println(0);
		// String s = sc.next();
		String sarr[] = ss.split(",");
		int aarr[] = new int[sarr.length];
		// sarr[] = ;
		// System.out.println("fghj");
		for(int i=0;i<sarr.length;i++)
			aarr[i]=Integer.parseInt(sarr[i]);
		Arrays.sort(aarr);
		
		int count = 0;
		for(int i=sarr.length - 1;i>0;i--)
			count+= aarr[i]-aarr[i-1];

		System.out.println(count);
	}
}