import java.util.Scanner;

public class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		int[] a = new int[3];
		
		for(int i = 0; i < 3; i++) {
			a[i] = sc.nextInt();
		}
		int ans = Integer.MAX_VALUE;
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				if(i == j) continue;
				int jc = Math.abs(a[j] - a[i]);
				for(int k = 0; k < 3; k++) {
					if(i == k || j == k) continue;
					int kc = Math.abs(a[k] - a[j]);
					if(ans > jc + kc) ans = jc + kc;
				}
			}
		}
		
		System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util public class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		int[] a = new int[3];
		
		for(int i = 0; i < 3; i++) {
			a[i] = sc.nextInt();
		}
		int ans = Integer.MAX_VALUE;
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				if(i == j) continue;
				int jc = Math.abs(a[j] - a[i]);
				for(int k = 0; k < 3; k++) {
					if(i == k || j == k) continue;
					int kc = Math.abs(a[k] - a[j]);
					if(ans > jc + kc) ans = jc + kc;
				}
			}
		}
		
		System.out.println(ans);
    }
} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
		int[] a = new int[3];
		
		for(int i = 0; i < 3; i++) {
			a[i] = sc.nextInt();
		}
		int ans = Integer.MAX_VALUE;
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				if(i == j) continue;
				int jc = Math.abs(a[j] - a[i]);
				for(int k = 0; k < 3; k++) {
					if(i == k || j == k) continue;
					int kc = Math.abs(a[k] - a[j]);
					if(ans > jc + kc) ans = jc + kc;
				}
			}
		}
		
		System.out.println(ans);
    } main {
		int[] a = new int[3];
		
		for(int i = 0; i < 3; i++) {
			a[i] = sc.nextInt();
		}
		int ans = Integer.MAX_VALUE;
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				if(i == j) continue;
				int jc = Math.abs(a[j] - a[i]);
				for(int k = 0; k < 3; k++) {
					if(i == k || j == k) continue;
					int kc = Math.abs(a[k] - a[j]);
					if(ans > jc + kc) ans = jc + kc;
				}
			}
		}
		
		System.out.println(ans);
    } int[] a = new int[3]; a new int[3] 3 for(int i = 0; i < 3; i++) {
			a[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			a[i] = sc.nextInt();
		} {
			a[i] = sc.nextInt();
		} a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc int ans = Integer.MAX_VALUE; ans Integer.MAX_VALUE Integer Integer.MAX_VALUE for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				if(i == j) continue;
				int jc = Math.abs(a[j] - a[i]);
				for(int k = 0; k < 3; k++) {
					if(i == k || j == k) continue;
					int kc = Math.abs(a[k] - a[j]);
					if(ans > jc + kc) ans = jc + kc;
				}
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			for(int j = 0; j < 3; j++) {
				if(i == j) continue;
				int jc = Math.abs(a[j] - a[i]);
				for(int k = 0; k < 3; k++) {
					if(i == k || j == k) continue;
					int kc = Math.abs(a[k] - a[j]);
					if(ans > jc + kc) ans = jc + kc;
				}
			}
		} {
			for(int j = 0; j < 3; j++) {
				if(i == j) continue;
				int jc = Math.abs(a[j] - a[i]);
				for(int k = 0; k < 3; k++) {
					if(i == k || j == k) continue;
					int kc = Math.abs(a[k] - a[j]);
					if(ans > jc + kc) ans = jc + kc;
				}
			}
		} for(int j = 0; j < 3; j++) {
				if(i == j) continue;
				int jc = Math.abs(a[j] - a[i]);
				for(int k = 0; k < 3; k++) {
					if(i == k || j == k) continue;
					int kc = Math.abs(a[k] - a[j]);
					if(ans > jc + kc) ans = jc + kc;
				}
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				if(i == j) continue;
				int jc = Math.abs(a[j] - a[i]);
				for(int k = 0; k < 3; k++) {
					if(i == k || j == k) continue;
					int kc = Math.abs(a[k] - a[j]);
					if(ans > jc + kc) ans = jc + kc;
				}
			} {
				if(i == j) continue;
				int jc = Math.abs(a[j] - a[i]);
				for(int k = 0; k < 3; k++) {
					if(i == k || j == k) continue;
					int kc = Math.abs(a[k] - a[j]);
					if(ans > jc + kc) ans = jc + kc;
				}
			} if(i == j) continue; i == j i j continue; int jc = Math.abs(a[j] - a[i]); jc Math.abs(a[j] - a[i]) Math.abs Math a[j] - a[i] a[j] a j a[i] a i for(int k = 0; k < 3; k++) {
					if(i == k || j == k) continue;
					int kc = Math.abs(a[k] - a[j]);
					if(ans > jc + kc) ans = jc + kc;
				} int k = 0; int k = 0; k 0 k < 3 k 3 k++ k++ k {
					if(i == k || j == k) continue;
					int kc = Math.abs(a[k] - a[j]);
					if(ans > jc + kc) ans = jc + kc;
				} {
					if(i == k || j == k) continue;
					int kc = Math.abs(a[k] - a[j]);
					if(ans > jc + kc) ans = jc + kc;
				} if(i == k || j == k) continue; i == k || j == k i == k i k j == k j k continue; int kc = Math.abs(a[k] - a[j]); kc Math.abs(a[k] - a[j]) Math.abs Math a[k] - a[j] a[k] a k a[j] a j if(ans > jc + kc) ans = jc + kc; ans > jc + kc ans jc + kc jc kc ans = jc + kc ans jc + kc jc kc System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		int[] a = new int[3];
		
		for(int i = 0; i < 3; i++) {
			a[i] = sc.nextInt();
		}
		int ans = Integer.MAX_VALUE;
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				if(i == j) continue;
				int jc = Math.abs(a[j] - a[i]);
				for(int k = 0; k < 3; k++) {
					if(i == k || j == k) continue;
					int kc = Math.abs(a[k] - a[j]);
					if(ans > jc + kc) ans = jc + kc;
				}
			}
		}
		
		System.out.println(ans);
    }
} public class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		int[] a = new int[3];
		
		for(int i = 0; i < 3; i++) {
			a[i] = sc.nextInt();
		}
		int ans = Integer.MAX_VALUE;
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				if(i == j) continue;
				int jc = Math.abs(a[j] - a[i]);
				for(int k = 0; k < 3; k++) {
					if(i == k || j == k) continue;
					int kc = Math.abs(a[k] - a[j]);
					if(ans > jc + kc) ans = jc + kc;
				}
			}
		}
		
		System.out.println(ans);
    }
} Main
import java.util.Scanner;

public class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		int[] a = new int[3];
		
		for(int i = 0; i < 3; i++) {
			a[i] = sc.nextInt();
		}
		int ans = Integer.MAX_VALUE;
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				if(i == j) continue;
				int jc = Math.abs(a[j] - a[i]);
				for(int k = 0; k < 3; k++) {
					if(i == k || j == k) continue;
					int kc = Math.abs(a[k] - a[j]);
					if(ans > jc + kc) ans = jc + kc;
				}
			}
		}
		
		System.out.println(ans);
    }
}
