import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] a = new int[]{sc.nextInt(), sc.nextInt(), sc.nextInt()};

        // 昇順に並び替え
        Arrays.sort(a);

        int cost = 0;
        cost += a[1] - a[0];
        cost += a[2] - a[1];

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

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] a = new int[]{sc.nextInt(), sc.nextInt(), sc.nextInt()};

        // 昇順に並び替え
        Arrays.sort(a);

        int cost = 0;
        cost += a[1] - a[0];
        cost += a[2] - a[1];

        System.out.println(cost);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] a = new int[]{sc.nextInt(), sc.nextInt(), sc.nextInt()};

        // 昇順に並び替え
        Arrays.sort(a);

        int cost = 0;
        cost += a[1] - a[0];
        cost += a[2] - a[1];

        System.out.println(cost);
    } main {
        Scanner sc = new Scanner(System.in);
        int[] a = new int[]{sc.nextInt(), sc.nextInt(), sc.nextInt()};

        // 昇順に並び替え
        Arrays.sort(a);

        int cost = 0;
        cost += a[1] - a[0];
        cost += a[2] - a[1];

        System.out.println(cost);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] a = new int[]{sc.nextInt(), sc.nextInt(), sc.nextInt()}; a new int[]{sc.nextInt(), sc.nextInt(), sc.nextInt()} Arrays.sort(a) Arrays.sort Arrays a int cost = 0; cost 0 cost += a[1] - a[0] cost a[1] - a[0] a[1] a 1 a[0] a 0 cost += a[2] - a[1] cost a[2] - a[1] a[2] a 2 a[1] a 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) {
        Scanner sc = new Scanner(System.in);
        int[] a = new int[]{sc.nextInt(), sc.nextInt(), sc.nextInt()};

        // 昇順に並び替え
        Arrays.sort(a);

        int cost = 0;
        cost += a[1] - a[0];
        cost += a[2] - a[1];

        System.out.println(cost);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] a = new int[]{sc.nextInt(), sc.nextInt(), sc.nextInt()};

        // 昇順に並び替え
        Arrays.sort(a);

        int cost = 0;
        cost += a[1] - a[0];
        cost += a[2] - a[1];

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

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] a = new int[]{sc.nextInt(), sc.nextInt(), sc.nextInt()};

        // 昇順に並び替え
        Arrays.sort(a);

        int cost = 0;
        cost += a[1] - a[0];
        cost += a[2] - a[1];

        System.out.println(cost);
    }
}
