import java.util.*;

public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] nums = new int[3];
        for(int i = 0; i < 3; i++)
        	nums[i] = sc.nextInt();
        Arrays.sort(nums);
        int cost = 0;
        for(int i = 1; i < 3; i++)
        	cost += nums[i] - nums[i - 1];

        System.out.println(cost);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] nums = new int[3];
        for(int i = 0; i < 3; i++)
        	nums[i] = sc.nextInt();
        Arrays.sort(nums);
        int cost = 0;
        for(int i = 1; i < 3; i++)
        	cost += nums[i] - nums[i - 1];

        System.out.println(cost);
    }
} Main public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] nums = new int[3];
        for(int i = 0; i < 3; i++)
        	nums[i] = sc.nextInt();
        Arrays.sort(nums);
        int cost = 0;
        for(int i = 1; i < 3; i++)
        	cost += nums[i] - nums[i - 1];

        System.out.println(cost);
    } main {
        Scanner sc = new Scanner(System.in);
        int[] nums = new int[3];
        for(int i = 0; i < 3; i++)
        	nums[i] = sc.nextInt();
        Arrays.sort(nums);
        int cost = 0;
        for(int i = 1; i < 3; i++)
        	cost += nums[i] - nums[i - 1];

        System.out.println(cost);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] nums = new int[3]; nums new int[3] 3 for(int i = 0; i < 3; i++)
        	nums[i] = sc.nextInt(); int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i nums[i] = sc.nextInt(); nums[i] = sc.nextInt() nums[i] nums i sc.nextInt() sc.nextInt sc Arrays.sort(nums) Arrays.sort Arrays nums int cost = 0; cost 0 for(int i = 1; i < 3; i++)
        	cost += nums[i] - nums[i - 1]; int i = 1; int i = 1; i 1 i < 3 i 3 i++ i++ i cost += nums[i] - nums[i - 1]; cost += nums[i] - nums[i - 1] cost nums[i] - nums[i - 1] nums[i] nums i nums[i - 1] nums i - 1 i 1 System.out.println(cost) System.out.println System.out System System.out cost String args[] args public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] nums = new int[3];
        for(int i = 0; i < 3; i++)
        	nums[i] = sc.nextInt();
        Arrays.sort(nums);
        int cost = 0;
        for(int i = 1; i < 3; i++)
        	cost += nums[i] - nums[i - 1];

        System.out.println(cost);
    }
} public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] nums = new int[3];
        for(int i = 0; i < 3; i++)
        	nums[i] = sc.nextInt();
        Arrays.sort(nums);
        int cost = 0;
        for(int i = 1; i < 3; i++)
        	cost += nums[i] - nums[i - 1];

        System.out.println(cost);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] nums = new int[3];
        for(int i = 0; i < 3; i++)
        	nums[i] = sc.nextInt();
        Arrays.sort(nums);
        int cost = 0;
        for(int i = 1; i < 3; i++)
        	cost += nums[i] - nums[i - 1];

        System.out.println(cost);
    }
}
