import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int[] A = new int[3];
            for (int i = 0; i < 3; i++) {
                A[i] = in.nextInt();
            }

            int min = (int) 1e9;
            min = Math.min(min, Math.abs(A[0] - A[1]) + Math.abs(A[1] - A[2]));
            min = Math.min(min, Math.abs(A[0] - A[2]) + Math.abs(A[2] - A[1]));
            min = Math.min(min, Math.abs(A[1] - A[0]) + Math.abs(A[0] - A[2]));
            min = Math.min(min, Math.abs(A[1] - A[2]) + Math.abs(A[2] - A[0]));
            min = Math.min(min, Math.abs(A[2] - A[0]) + Math.abs(A[0] - A[1]));
            min = Math.min(min, Math.abs(A[2] - A[1]) + Math.abs(A[1] - A[0]));

            System.out.println(min);
        }
    }

} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int[] A = new int[3];
            for (int i = 0; i < 3; i++) {
                A[i] = in.nextInt();
            }

            int min = (int) 1e9;
            min = Math.min(min, Math.abs(A[0] - A[1]) + Math.abs(A[1] - A[2]));
            min = Math.min(min, Math.abs(A[0] - A[2]) + Math.abs(A[2] - A[1]));
            min = Math.min(min, Math.abs(A[1] - A[0]) + Math.abs(A[0] - A[2]));
            min = Math.min(min, Math.abs(A[1] - A[2]) + Math.abs(A[2] - A[0]));
            min = Math.min(min, Math.abs(A[2] - A[0]) + Math.abs(A[0] - A[1]));
            min = Math.min(min, Math.abs(A[2] - A[1]) + Math.abs(A[1] - A[0]));

            System.out.println(min);
        }
    }

} Main public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int[] A = new int[3];
            for (int i = 0; i < 3; i++) {
                A[i] = in.nextInt();
            }

            int min = (int) 1e9;
            min = Math.min(min, Math.abs(A[0] - A[1]) + Math.abs(A[1] - A[2]));
            min = Math.min(min, Math.abs(A[0] - A[2]) + Math.abs(A[2] - A[1]));
            min = Math.min(min, Math.abs(A[1] - A[0]) + Math.abs(A[0] - A[2]));
            min = Math.min(min, Math.abs(A[1] - A[2]) + Math.abs(A[2] - A[0]));
            min = Math.min(min, Math.abs(A[2] - A[0]) + Math.abs(A[0] - A[1]));
            min = Math.min(min, Math.abs(A[2] - A[1]) + Math.abs(A[1] - A[0]));

            System.out.println(min);
        }
    } main {
        try (Scanner in = new Scanner(System.in)) {
            int[] A = new int[3];
            for (int i = 0; i < 3; i++) {
                A[i] = in.nextInt();
            }

            int min = (int) 1e9;
            min = Math.min(min, Math.abs(A[0] - A[1]) + Math.abs(A[1] - A[2]));
            min = Math.min(min, Math.abs(A[0] - A[2]) + Math.abs(A[2] - A[1]));
            min = Math.min(min, Math.abs(A[1] - A[0]) + Math.abs(A[0] - A[2]));
            min = Math.min(min, Math.abs(A[1] - A[2]) + Math.abs(A[2] - A[0]));
            min = Math.min(min, Math.abs(A[2] - A[0]) + Math.abs(A[0] - A[1]));
            min = Math.min(min, Math.abs(A[2] - A[1]) + Math.abs(A[1] - A[0]));

            System.out.println(min);
        }
    } try (Scanner in = new Scanner(System.in)) {
            int[] A = new int[3];
            for (int i = 0; i < 3; i++) {
                A[i] = in.nextInt();
            }

            int min = (int) 1e9;
            min = Math.min(min, Math.abs(A[0] - A[1]) + Math.abs(A[1] - A[2]));
            min = Math.min(min, Math.abs(A[0] - A[2]) + Math.abs(A[2] - A[1]));
            min = Math.min(min, Math.abs(A[1] - A[0]) + Math.abs(A[0] - A[2]));
            min = Math.min(min, Math.abs(A[1] - A[2]) + Math.abs(A[2] - A[0]));
            min = Math.min(min, Math.abs(A[2] - A[0]) + Math.abs(A[0] - A[1]));
            min = Math.min(min, Math.abs(A[2] - A[1]) + Math.abs(A[1] - A[0]));

            System.out.println(min);
        } {
            int[] A = new int[3];
            for (int i = 0; i < 3; i++) {
                A[i] = in.nextInt();
            }

            int min = (int) 1e9;
            min = Math.min(min, Math.abs(A[0] - A[1]) + Math.abs(A[1] - A[2]));
            min = Math.min(min, Math.abs(A[0] - A[2]) + Math.abs(A[2] - A[1]));
            min = Math.min(min, Math.abs(A[1] - A[0]) + Math.abs(A[0] - A[2]));
            min = Math.min(min, Math.abs(A[1] - A[2]) + Math.abs(A[2] - A[0]));
            min = Math.min(min, Math.abs(A[2] - A[0]) + Math.abs(A[0] - A[1]));
            min = Math.min(min, Math.abs(A[2] - A[1]) + Math.abs(A[1] - A[0]));

            System.out.println(min);
        } Scanner in = new Scanner(System.in) Scanner in = new Scanner(System.in) new Scanner(System.in) int[] A = new int[3]; A new int[3] 3 for (int i = 0; i < 3; i++) {
                A[i] = in.nextInt();
            } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
                A[i] = in.nextInt();
            } {
                A[i] = in.nextInt();
            } A[i] = in.nextInt() A[i] A i in.nextInt() in.nextInt in int min = (int) 1e9; min (int) 1e9 min = Math.min(min, Math.abs(A[0] - A[1]) + Math.abs(A[1] - A[2])) min Math.min(min, Math.abs(A[0] - A[1]) + Math.abs(A[1] - A[2])) Math.min Math min Math.abs(A[0] - A[1]) + Math.abs(A[1] - A[2]) Math.abs(A[0] - A[1]) Math.abs Math A[0] - A[1] A[0] A 0 A[1] A 1 Math.abs(A[1] - A[2]) Math.abs Math A[1] - A[2] A[1] A 1 A[2] A 2 min = Math.min(min, Math.abs(A[0] - A[2]) + Math.abs(A[2] - A[1])) min Math.min(min, Math.abs(A[0] - A[2]) + Math.abs(A[2] - A[1])) Math.min Math min Math.abs(A[0] - A[2]) + Math.abs(A[2] - A[1]) Math.abs(A[0] - A[2]) Math.abs Math A[0] - A[2] A[0] A 0 A[2] A 2 Math.abs(A[2] - A[1]) Math.abs Math A[2] - A[1] A[2] A 2 A[1] A 1 min = Math.min(min, Math.abs(A[1] - A[0]) + Math.abs(A[0] - A[2])) min Math.min(min, Math.abs(A[1] - A[0]) + Math.abs(A[0] - A[2])) Math.min Math min Math.abs(A[1] - A[0]) + Math.abs(A[0] - A[2]) Math.abs(A[1] - A[0]) Math.abs Math A[1] - A[0] A[1] A 1 A[0] A 0 Math.abs(A[0] - A[2]) Math.abs Math A[0] - A[2] A[0] A 0 A[2] A 2 min = Math.min(min, Math.abs(A[1] - A[2]) + Math.abs(A[2] - A[0])) min Math.min(min, Math.abs(A[1] - A[2]) + Math.abs(A[2] - A[0])) Math.min Math min Math.abs(A[1] - A[2]) + Math.abs(A[2] - A[0]) Math.abs(A[1] - A[2]) Math.abs Math A[1] - A[2] A[1] A 1 A[2] A 2 Math.abs(A[2] - A[0]) Math.abs Math A[2] - A[0] A[2] A 2 A[0] A 0 min = Math.min(min, Math.abs(A[2] - A[0]) + Math.abs(A[0] - A[1])) min Math.min(min, Math.abs(A[2] - A[0]) + Math.abs(A[0] - A[1])) Math.min Math min Math.abs(A[2] - A[0]) + Math.abs(A[0] - A[1]) Math.abs(A[2] - A[0]) Math.abs Math A[2] - A[0] A[2] A 2 A[0] A 0 Math.abs(A[0] - A[1]) Math.abs Math A[0] - A[1] A[0] A 0 A[1] A 1 min = Math.min(min, Math.abs(A[2] - A[1]) + Math.abs(A[1] - A[0])) min Math.min(min, Math.abs(A[2] - A[1]) + Math.abs(A[1] - A[0])) Math.min Math min Math.abs(A[2] - A[1]) + Math.abs(A[1] - A[0]) Math.abs(A[2] - A[1]) Math.abs Math A[2] - A[1] A[2] A 2 A[1] A 1 Math.abs(A[1] - A[0]) Math.abs Math A[1] - A[0] A[1] A 1 A[0] A 0 System.out.println(min) System.out.println System.out System System.out min String args[] args public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int[] A = new int[3];
            for (int i = 0; i < 3; i++) {
                A[i] = in.nextInt();
            }

            int min = (int) 1e9;
            min = Math.min(min, Math.abs(A[0] - A[1]) + Math.abs(A[1] - A[2]));
            min = Math.min(min, Math.abs(A[0] - A[2]) + Math.abs(A[2] - A[1]));
            min = Math.min(min, Math.abs(A[1] - A[0]) + Math.abs(A[0] - A[2]));
            min = Math.min(min, Math.abs(A[1] - A[2]) + Math.abs(A[2] - A[0]));
            min = Math.min(min, Math.abs(A[2] - A[0]) + Math.abs(A[0] - A[1]));
            min = Math.min(min, Math.abs(A[2] - A[1]) + Math.abs(A[1] - A[0]));

            System.out.println(min);
        }
    }

} public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int[] A = new int[3];
            for (int i = 0; i < 3; i++) {
                A[i] = in.nextInt();
            }

            int min = (int) 1e9;
            min = Math.min(min, Math.abs(A[0] - A[1]) + Math.abs(A[1] - A[2]));
            min = Math.min(min, Math.abs(A[0] - A[2]) + Math.abs(A[2] - A[1]));
            min = Math.min(min, Math.abs(A[1] - A[0]) + Math.abs(A[0] - A[2]));
            min = Math.min(min, Math.abs(A[1] - A[2]) + Math.abs(A[2] - A[0]));
            min = Math.min(min, Math.abs(A[2] - A[0]) + Math.abs(A[0] - A[1]));
            min = Math.min(min, Math.abs(A[2] - A[1]) + Math.abs(A[1] - A[0]));

            System.out.println(min);
        }
    }

} Main
import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int[] A = new int[3];
            for (int i = 0; i < 3; i++) {
                A[i] = in.nextInt();
            }

            int min = (int) 1e9;
            min = Math.min(min, Math.abs(A[0] - A[1]) + Math.abs(A[1] - A[2]));
            min = Math.min(min, Math.abs(A[0] - A[2]) + Math.abs(A[2] - A[1]));
            min = Math.min(min, Math.abs(A[1] - A[0]) + Math.abs(A[0] - A[2]));
            min = Math.min(min, Math.abs(A[1] - A[2]) + Math.abs(A[2] - A[0]));
            min = Math.min(min, Math.abs(A[2] - A[0]) + Math.abs(A[0] - A[1]));
            min = Math.min(min, Math.abs(A[2] - A[1]) + Math.abs(A[1] - A[0]));

            System.out.println(min);
        }
    }

}
