import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] arr = new int[3];
        arr[0] = Integer.parseInt(sc.next());
        arr[1] = Integer.parseInt(sc.next());
        arr[2] = Integer.parseInt(sc.next());
        
        Arrays.sort(arr);
        for(int i = 0; i < arr.length/2; i++){
            int bef = 0;
            int aft = 0;
            bef = arr[i];
            aft = arr[arr.length-1-i];
            arr[i] = aft;
            arr[arr.length-1-i] = bef;
            
        }
        int sum = 0;
        for(int i = 0; i < arr.length-1; i++){
            sum += Math.abs(arr[arr.length-1-i] - arr[arr.length-1-i-1]);
        }
        System.out.println(sum);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] arr = new int[3];
        arr[0] = Integer.parseInt(sc.next());
        arr[1] = Integer.parseInt(sc.next());
        arr[2] = Integer.parseInt(sc.next());
        
        Arrays.sort(arr);
        for(int i = 0; i < arr.length/2; i++){
            int bef = 0;
            int aft = 0;
            bef = arr[i];
            aft = arr[arr.length-1-i];
            arr[i] = aft;
            arr[arr.length-1-i] = bef;
            
        }
        int sum = 0;
        for(int i = 0; i < arr.length-1; i++){
            sum += Math.abs(arr[arr.length-1-i] - arr[arr.length-1-i-1]);
        }
        System.out.println(sum);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] arr = new int[3];
        arr[0] = Integer.parseInt(sc.next());
        arr[1] = Integer.parseInt(sc.next());
        arr[2] = Integer.parseInt(sc.next());
        
        Arrays.sort(arr);
        for(int i = 0; i < arr.length/2; i++){
            int bef = 0;
            int aft = 0;
            bef = arr[i];
            aft = arr[arr.length-1-i];
            arr[i] = aft;
            arr[arr.length-1-i] = bef;
            
        }
        int sum = 0;
        for(int i = 0; i < arr.length-1; i++){
            sum += Math.abs(arr[arr.length-1-i] - arr[arr.length-1-i-1]);
        }
        System.out.println(sum);
    } main {
        Scanner sc = new Scanner(System.in);
        int[] arr = new int[3];
        arr[0] = Integer.parseInt(sc.next());
        arr[1] = Integer.parseInt(sc.next());
        arr[2] = Integer.parseInt(sc.next());
        
        Arrays.sort(arr);
        for(int i = 0; i < arr.length/2; i++){
            int bef = 0;
            int aft = 0;
            bef = arr[i];
            aft = arr[arr.length-1-i];
            arr[i] = aft;
            arr[arr.length-1-i] = bef;
            
        }
        int sum = 0;
        for(int i = 0; i < arr.length-1; i++){
            sum += Math.abs(arr[arr.length-1-i] - arr[arr.length-1-i-1]);
        }
        System.out.println(sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] arr = new int[3]; arr new int[3] 3 arr[0] = Integer.parseInt(sc.next()) arr[0] arr 0 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc arr[1] = Integer.parseInt(sc.next()) arr[1] arr 1 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc arr[2] = Integer.parseInt(sc.next()) arr[2] arr 2 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Arrays.sort(arr) Arrays.sort Arrays arr for(int i = 0; i < arr.length/2; i++){
            int bef = 0;
            int aft = 0;
            bef = arr[i];
            aft = arr[arr.length-1-i];
            arr[i] = aft;
            arr[arr.length-1-i] = bef;
            
        } int i = 0; int i = 0; i 0 i < arr.length/2 i arr.length/2 arr.length arr arr.length 2 i++ i++ i {
            int bef = 0;
            int aft = 0;
            bef = arr[i];
            aft = arr[arr.length-1-i];
            arr[i] = aft;
            arr[arr.length-1-i] = bef;
            
        } {
            int bef = 0;
            int aft = 0;
            bef = arr[i];
            aft = arr[arr.length-1-i];
            arr[i] = aft;
            arr[arr.length-1-i] = bef;
            
        } int bef = 0; bef 0 int aft = 0; aft 0 bef = arr[i] bef arr[i] arr i aft = arr[arr.length-1-i] aft arr[arr.length-1-i] arr arr.length-1-i arr.length-1-i arr.length arr arr.length 1 i arr[i] = aft arr[i] arr i aft arr[arr.length-1-i] = bef arr[arr.length-1-i] arr arr.length-1-i arr.length-1-i arr.length arr arr.length 1 i bef int sum = 0; sum 0 for(int i = 0; i < arr.length-1; i++){
            sum += Math.abs(arr[arr.length-1-i] - arr[arr.length-1-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 {
            sum += Math.abs(arr[arr.length-1-i] - arr[arr.length-1-i-1]);
        } {
            sum += Math.abs(arr[arr.length-1-i] - arr[arr.length-1-i-1]);
        } sum += Math.abs(arr[arr.length-1-i] - arr[arr.length-1-i-1]) sum Math.abs(arr[arr.length-1-i] - arr[arr.length-1-i-1]) Math.abs Math arr[arr.length-1-i] - arr[arr.length-1-i-1] arr[arr.length-1-i] arr arr.length-1-i arr.length-1-i arr.length arr arr.length 1 i arr[arr.length-1-i-1] arr arr.length-1-i-1 i arr.length-1-i-1 arr.length arr arr.length 1 i 1 System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] arr = new int[3];
        arr[0] = Integer.parseInt(sc.next());
        arr[1] = Integer.parseInt(sc.next());
        arr[2] = Integer.parseInt(sc.next());
        
        Arrays.sort(arr);
        for(int i = 0; i < arr.length/2; i++){
            int bef = 0;
            int aft = 0;
            bef = arr[i];
            aft = arr[arr.length-1-i];
            arr[i] = aft;
            arr[arr.length-1-i] = bef;
            
        }
        int sum = 0;
        for(int i = 0; i < arr.length-1; i++){
            sum += Math.abs(arr[arr.length-1-i] - arr[arr.length-1-i-1]);
        }
        System.out.println(sum);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] arr = new int[3];
        arr[0] = Integer.parseInt(sc.next());
        arr[1] = Integer.parseInt(sc.next());
        arr[2] = Integer.parseInt(sc.next());
        
        Arrays.sort(arr);
        for(int i = 0; i < arr.length/2; i++){
            int bef = 0;
            int aft = 0;
            bef = arr[i];
            aft = arr[arr.length-1-i];
            arr[i] = aft;
            arr[arr.length-1-i] = bef;
            
        }
        int sum = 0;
        for(int i = 0; i < arr.length-1; i++){
            sum += Math.abs(arr[arr.length-1-i] - arr[arr.length-1-i-1]);
        }
        System.out.println(sum);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] arr = new int[3];
        arr[0] = Integer.parseInt(sc.next());
        arr[1] = Integer.parseInt(sc.next());
        arr[2] = Integer.parseInt(sc.next());
        
        Arrays.sort(arr);
        for(int i = 0; i < arr.length/2; i++){
            int bef = 0;
            int aft = 0;
            bef = arr[i];
            aft = arr[arr.length-1-i];
            arr[i] = aft;
            arr[arr.length-1-i] = bef;
            
        }
        int sum = 0;
        for(int i = 0; i < arr.length-1; i++){
            sum += Math.abs(arr[arr.length-1-i] - arr[arr.length-1-i-1]);
        }
        System.out.println(sum);
    }
}