import java.util.Scanner;

public class Main {

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

            int diff1 = Math.abs(a - b);
            int diff2 = Math.abs(b - c);
            int diff3 = Math.abs(c - a);
            int max = Math.max(Math.max(diff1, diff2), diff3);
            int ans = diff1 + diff2 + diff3 - max;
            System.out.println(ans);

        }
    }

} import java.util.Scanner; Scanner java.util public class Main {

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

            int diff1 = Math.abs(a - b);
            int diff2 = Math.abs(b - c);
            int diff3 = Math.abs(c - a);
            int max = Math.max(Math.max(diff1, diff2), diff3);
            int ans = diff1 + diff2 + diff3 - max;
            System.out.println(ans);

        }
    }

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

            int diff1 = Math.abs(a - b);
            int diff2 = Math.abs(b - c);
            int diff3 = Math.abs(c - a);
            int max = Math.max(Math.max(diff1, diff2), diff3);
            int ans = diff1 + diff2 + diff3 - max;
            System.out.println(ans);

        }
    } main {
        try (Scanner sc = new Scanner(System.in)) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();

            int diff1 = Math.abs(a - b);
            int diff2 = Math.abs(b - c);
            int diff3 = Math.abs(c - a);
            int max = Math.max(Math.max(diff1, diff2), diff3);
            int ans = diff1 + diff2 + diff3 - max;
            System.out.println(ans);

        }
    } try (Scanner sc = new Scanner(System.in)) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();

            int diff1 = Math.abs(a - b);
            int diff2 = Math.abs(b - c);
            int diff3 = Math.abs(c - a);
            int max = Math.max(Math.max(diff1, diff2), diff3);
            int ans = diff1 + diff2 + diff3 - max;
            System.out.println(ans);

        } {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();

            int diff1 = Math.abs(a - b);
            int diff2 = Math.abs(b - c);
            int diff3 = Math.abs(c - a);
            int max = Math.max(Math.max(diff1, diff2), diff3);
            int ans = diff1 + diff2 + diff3 - max;
            System.out.println(ans);

        } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc int diff1 = Math.abs(a - b); diff1 Math.abs(a - b) Math.abs Math a - b a b int diff2 = Math.abs(b - c); diff2 Math.abs(b - c) Math.abs Math b - c b c int diff3 = Math.abs(c - a); diff3 Math.abs(c - a) Math.abs Math c - a c a int max = Math.max(Math.max(diff1, diff2), diff3); max Math.max(Math.max(diff1, diff2), diff3) Math.max Math Math.max(diff1, diff2) Math.max Math diff1 diff2 diff3 int ans = diff1 + diff2 + diff3 - max; ans diff1 + diff2 + diff3 - max diff1 + diff2 + diff3 diff1 + diff2 + diff3 diff1 diff2 diff3 max System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

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

            int diff1 = Math.abs(a - b);
            int diff2 = Math.abs(b - c);
            int diff3 = Math.abs(c - a);
            int max = Math.max(Math.max(diff1, diff2), diff3);
            int ans = diff1 + diff2 + diff3 - max;
            System.out.println(ans);

        }
    }

} public class Main {

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

            int diff1 = Math.abs(a - b);
            int diff2 = Math.abs(b - c);
            int diff3 = Math.abs(c - a);
            int max = Math.max(Math.max(diff1, diff2), diff3);
            int ans = diff1 + diff2 + diff3 - max;
            System.out.println(ans);

        }
    }

} Main
import java.util.Scanner;

public class Main {

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

            int diff1 = Math.abs(a - b);
            int diff2 = Math.abs(b - c);
            int diff3 = Math.abs(c - a);
            int max = Math.max(Math.max(diff1, diff2), diff3);
            int ans = diff1 + diff2 + diff3 - max;
            System.out.println(ans);

        }
    }

}
