import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int A1 = scan.nextInt();
		int A2 = scan.nextInt();
		int A3 = scan.nextInt();
		scan.close();
		
		int max = 0;
		int mid = 0;
		int min = 0;
		if (A1 > A2) {
			max = A1;
			min = A2;
		} else {
			max = A2;
			min = A1;
		}
		
		if (max < A3) {
			max = A3;
			mid = max;
		} else {
			mid = A3;
		}
		
		if (mid < min) {
			int tmp = mid;
			mid = min;
			min = tmp;
		}
		
		int ans1 = 0;
		ans1 = mid - max;
		if (ans1 < 0) {
			ans1 = ans1 * -1;
		}
		
		int ans2 = 0;
		ans2 = min - mid;
		if (ans2 < 0) {
			ans2 = ans2 * -1;
		}
		System.out.print(ans1 + ans2); 
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int A1 = scan.nextInt();
		int A2 = scan.nextInt();
		int A3 = scan.nextInt();
		scan.close();
		
		int max = 0;
		int mid = 0;
		int min = 0;
		if (A1 > A2) {
			max = A1;
			min = A2;
		} else {
			max = A2;
			min = A1;
		}
		
		if (max < A3) {
			max = A3;
			mid = max;
		} else {
			mid = A3;
		}
		
		if (mid < min) {
			int tmp = mid;
			mid = min;
			min = tmp;
		}
		
		int ans1 = 0;
		ans1 = mid - max;
		if (ans1 < 0) {
			ans1 = ans1 * -1;
		}
		
		int ans2 = 0;
		ans2 = min - mid;
		if (ans2 < 0) {
			ans2 = ans2 * -1;
		}
		System.out.print(ans1 + ans2); 
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int A1 = scan.nextInt();
		int A2 = scan.nextInt();
		int A3 = scan.nextInt();
		scan.close();
		
		int max = 0;
		int mid = 0;
		int min = 0;
		if (A1 > A2) {
			max = A1;
			min = A2;
		} else {
			max = A2;
			min = A1;
		}
		
		if (max < A3) {
			max = A3;
			mid = max;
		} else {
			mid = A3;
		}
		
		if (mid < min) {
			int tmp = mid;
			mid = min;
			min = tmp;
		}
		
		int ans1 = 0;
		ans1 = mid - max;
		if (ans1 < 0) {
			ans1 = ans1 * -1;
		}
		
		int ans2 = 0;
		ans2 = min - mid;
		if (ans2 < 0) {
			ans2 = ans2 * -1;
		}
		System.out.print(ans1 + ans2); 
	} main {
		Scanner scan = new Scanner(System.in);
		int A1 = scan.nextInt();
		int A2 = scan.nextInt();
		int A3 = scan.nextInt();
		scan.close();
		
		int max = 0;
		int mid = 0;
		int min = 0;
		if (A1 > A2) {
			max = A1;
			min = A2;
		} else {
			max = A2;
			min = A1;
		}
		
		if (max < A3) {
			max = A3;
			mid = max;
		} else {
			mid = A3;
		}
		
		if (mid < min) {
			int tmp = mid;
			mid = min;
			min = tmp;
		}
		
		int ans1 = 0;
		ans1 = mid - max;
		if (ans1 < 0) {
			ans1 = ans1 * -1;
		}
		
		int ans2 = 0;
		ans2 = min - mid;
		if (ans2 < 0) {
			ans2 = ans2 * -1;
		}
		System.out.print(ans1 + ans2); 
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int A1 = scan.nextInt(); A1 scan.nextInt() scan.nextInt scan int A2 = scan.nextInt(); A2 scan.nextInt() scan.nextInt scan int A3 = scan.nextInt(); A3 scan.nextInt() scan.nextInt scan scan.close() scan.close scan int max = 0; max 0 int mid = 0; mid 0 int min = 0; min 0 if (A1 > A2) {
			max = A1;
			min = A2;
		} else {
			max = A2;
			min = A1;
		} A1 > A2 A1 A2 {
			max = A1;
			min = A2;
		} max = A1 max A1 min = A2 min A2 {
			max = A2;
			min = A1;
		} max = A2 max A2 min = A1 min A1 if (max < A3) {
			max = A3;
			mid = max;
		} else {
			mid = A3;
		} max < A3 max A3 {
			max = A3;
			mid = max;
		} max = A3 max A3 mid = max mid max {
			mid = A3;
		} mid = A3 mid A3 if (mid < min) {
			int tmp = mid;
			mid = min;
			min = tmp;
		} mid < min mid min {
			int tmp = mid;
			mid = min;
			min = tmp;
		} int tmp = mid; tmp mid mid = min mid min min = tmp min tmp int ans1 = 0; ans1 0 ans1 = mid - max ans1 mid - max mid max if (ans1 < 0) {
			ans1 = ans1 * -1;
		} ans1 < 0 ans1 0 {
			ans1 = ans1 * -1;
		} ans1 = ans1 * -1 ans1 ans1 * -1 ans1 -1 1 int ans2 = 0; ans2 0 ans2 = min - mid ans2 min - mid min mid if (ans2 < 0) {
			ans2 = ans2 * -1;
		} ans2 < 0 ans2 0 {
			ans2 = ans2 * -1;
		} ans2 = ans2 * -1 ans2 ans2 * -1 ans2 -1 1 System.out.print(ans1 + ans2) System.out.print System.out System System.out ans1 + ans2 ans1 ans2 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int A1 = scan.nextInt();
		int A2 = scan.nextInt();
		int A3 = scan.nextInt();
		scan.close();
		
		int max = 0;
		int mid = 0;
		int min = 0;
		if (A1 > A2) {
			max = A1;
			min = A2;
		} else {
			max = A2;
			min = A1;
		}
		
		if (max < A3) {
			max = A3;
			mid = max;
		} else {
			mid = A3;
		}
		
		if (mid < min) {
			int tmp = mid;
			mid = min;
			min = tmp;
		}
		
		int ans1 = 0;
		ans1 = mid - max;
		if (ans1 < 0) {
			ans1 = ans1 * -1;
		}
		
		int ans2 = 0;
		ans2 = min - mid;
		if (ans2 < 0) {
			ans2 = ans2 * -1;
		}
		System.out.print(ans1 + ans2); 
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int A1 = scan.nextInt();
		int A2 = scan.nextInt();
		int A3 = scan.nextInt();
		scan.close();
		
		int max = 0;
		int mid = 0;
		int min = 0;
		if (A1 > A2) {
			max = A1;
			min = A2;
		} else {
			max = A2;
			min = A1;
		}
		
		if (max < A3) {
			max = A3;
			mid = max;
		} else {
			mid = A3;
		}
		
		if (mid < min) {
			int tmp = mid;
			mid = min;
			min = tmp;
		}
		
		int ans1 = 0;
		ans1 = mid - max;
		if (ans1 < 0) {
			ans1 = ans1 * -1;
		}
		
		int ans2 = 0;
		ans2 = min - mid;
		if (ans2 < 0) {
			ans2 = ans2 * -1;
		}
		System.out.print(ans1 + ans2); 
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int A1 = scan.nextInt();
		int A2 = scan.nextInt();
		int A3 = scan.nextInt();
		scan.close();
		
		int max = 0;
		int mid = 0;
		int min = 0;
		if (A1 > A2) {
			max = A1;
			min = A2;
		} else {
			max = A2;
			min = A1;
		}
		
		if (max < A3) {
			max = A3;
			mid = max;
		} else {
			mid = A3;
		}
		
		if (mid < min) {
			int tmp = mid;
			mid = min;
			min = tmp;
		}
		
		int ans1 = 0;
		ans1 = mid - max;
		if (ans1 < 0) {
			ans1 = ans1 * -1;
		}
		
		int ans2 = 0;
		ans2 = min - mid;
		if (ans2 < 0) {
			ans2 = ans2 * -1;
		}
		System.out.print(ans1 + ans2); 
	}
}
