

import java.io.PrintWriter;
import java.util.Scanner;
import java.util.Arrays;
import java.util.List;

public class Main {
    public static void main(String[] args){
        PrintWriter out = new PrintWriter(System.out);
        Scanner sc = new Scanner(System.in);
        Task task = new Task();
        task.solve(sc, out);
        out.flush();
        sc.close();
    }
    static class Task{
        public void solve(Scanner sc, PrintWriter out){
            int sum  = 0;
            int[] nint = intLine(sc, 3);
            Arrays.sort(nint);

            int a1 = nint[0];
            int a2 = nint[1];
            int a3 = nint[2];

            int a1a2 = Math.abs(a2-a1);
            int a1a3 = Math.abs(a3-a1);

            if (a1a2 <= a1a3){
                sum += a1a2 + Math.abs(a2-a3);
             }else {
                sum += a1a3 + Math.abs(a2-a3);
            }


            out.println(sum);

        }
    }

    static int nint(Scanner sc){
        return Integer.parseInt(sc.next());
    }
    static long nlong(Scanner sc){
        return Long.parseLong(sc.next());
    }
    static double ndouble(Scanner sc){
        return Double.parseDouble(sc.next());
    }
    static float nfloat(Scanner sc){
        return Float.parseFloat(sc.next());
    }
    static String nstr(Scanner sc){
        return  String.valueOf(sc.next());
    }
    static long[] longLine(Scanner sc, int size){
        long[] lLine = new long[size];
        for (int i = 0; i < size; i++) {
            lLine[i] = nlong(sc);
        }
        return lLine;
    }
    static int[] intLine(Scanner sc, int size){
        int[] iLine = new int[size];
        for (int i = 0; i < size; i++) {
            iLine[i] = nint(sc);
        }
        return iLine;
    }
    static String[] strLine(Scanner sc, int size){
        String[] strLine = new String[size];
        for (int i = 0; i < size; i++) {
            strLine[i] = nstr(sc);
        }
        return strLine;
    }
} import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util import java.util.List; List java.util public class Main {
    public static void main(String[] args){
        PrintWriter out = new PrintWriter(System.out);
        Scanner sc = new Scanner(System.in);
        Task task = new Task();
        task.solve(sc, out);
        out.flush();
        sc.close();
    }
    static class Task{
        public void solve(Scanner sc, PrintWriter out){
            int sum  = 0;
            int[] nint = intLine(sc, 3);
            Arrays.sort(nint);

            int a1 = nint[0];
            int a2 = nint[1];
            int a3 = nint[2];

            int a1a2 = Math.abs(a2-a1);
            int a1a3 = Math.abs(a3-a1);

            if (a1a2 <= a1a3){
                sum += a1a2 + Math.abs(a2-a3);
             }else {
                sum += a1a3 + Math.abs(a2-a3);
            }


            out.println(sum);

        }
    }

    static int nint(Scanner sc){
        return Integer.parseInt(sc.next());
    }
    static long nlong(Scanner sc){
        return Long.parseLong(sc.next());
    }
    static double ndouble(Scanner sc){
        return Double.parseDouble(sc.next());
    }
    static float nfloat(Scanner sc){
        return Float.parseFloat(sc.next());
    }
    static String nstr(Scanner sc){
        return  String.valueOf(sc.next());
    }
    static long[] longLine(Scanner sc, int size){
        long[] lLine = new long[size];
        for (int i = 0; i < size; i++) {
            lLine[i] = nlong(sc);
        }
        return lLine;
    }
    static int[] intLine(Scanner sc, int size){
        int[] iLine = new int[size];
        for (int i = 0; i < size; i++) {
            iLine[i] = nint(sc);
        }
        return iLine;
    }
    static String[] strLine(Scanner sc, int size){
        String[] strLine = new String[size];
        for (int i = 0; i < size; i++) {
            strLine[i] = nstr(sc);
        }
        return strLine;
    }
} Main public static void main(String[] args){
        PrintWriter out = new PrintWriter(System.out);
        Scanner sc = new Scanner(System.in);
        Task task = new Task();
        task.solve(sc, out);
        out.flush();
        sc.close();
    } main {
        PrintWriter out = new PrintWriter(System.out);
        Scanner sc = new Scanner(System.in);
        Task task = new Task();
        task.solve(sc, out);
        out.flush();
        sc.close();
    } PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Task task = new Task(); task new Task() task.solve(sc, out) task.solve task sc out out.flush() out.flush out sc.close() sc.close sc String[] args args static int nint(Scanner sc){
        return Integer.parseInt(sc.next());
    } nint {
        return Integer.parseInt(sc.next());
    } return Integer.parseInt(sc.next()); Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Scanner sc sc static long nlong(Scanner sc){
        return Long.parseLong(sc.next());
    } nlong {
        return Long.parseLong(sc.next());
    } return Long.parseLong(sc.next()); Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc Scanner sc sc static double ndouble(Scanner sc){
        return Double.parseDouble(sc.next());
    } ndouble {
        return Double.parseDouble(sc.next());
    } return Double.parseDouble(sc.next()); Double.parseDouble(sc.next()) Double.parseDouble Double sc.next() sc.next sc Scanner sc sc static float nfloat(Scanner sc){
        return Float.parseFloat(sc.next());
    } nfloat {
        return Float.parseFloat(sc.next());
    } return Float.parseFloat(sc.next()); Float.parseFloat(sc.next()) Float.parseFloat Float sc.next() sc.next sc Scanner sc sc static String nstr(Scanner sc){
        return  String.valueOf(sc.next());
    } nstr {
        return  String.valueOf(sc.next());
    } return  String.valueOf(sc.next()); String.valueOf(sc.next()) String.valueOf String sc.next() sc.next sc Scanner sc sc static long[] longLine(Scanner sc, int size){
        long[] lLine = new long[size];
        for (int i = 0; i < size; i++) {
            lLine[i] = nlong(sc);
        }
        return lLine;
    } longLine {
        long[] lLine = new long[size];
        for (int i = 0; i < size; i++) {
            lLine[i] = nlong(sc);
        }
        return lLine;
    } long[] lLine = new long[size]; lLine new long[size] size for (int i = 0; i < size; i++) {
            lLine[i] = nlong(sc);
        } int i = 0; int i = 0; i 0 i < size i size i++ i++ i {
            lLine[i] = nlong(sc);
        } {
            lLine[i] = nlong(sc);
        } lLine[i] = nlong(sc) lLine[i] lLine i nlong(sc) nlong sc return lLine; lLine Scanner sc sc int size size static int[] intLine(Scanner sc, int size){
        int[] iLine = new int[size];
        for (int i = 0; i < size; i++) {
            iLine[i] = nint(sc);
        }
        return iLine;
    } intLine {
        int[] iLine = new int[size];
        for (int i = 0; i < size; i++) {
            iLine[i] = nint(sc);
        }
        return iLine;
    } int[] iLine = new int[size]; iLine new int[size] size for (int i = 0; i < size; i++) {
            iLine[i] = nint(sc);
        } int i = 0; int i = 0; i 0 i < size i size i++ i++ i {
            iLine[i] = nint(sc);
        } {
            iLine[i] = nint(sc);
        } iLine[i] = nint(sc) iLine[i] iLine i nint(sc) nint sc return iLine; iLine Scanner sc sc int size size static String[] strLine(Scanner sc, int size){
        String[] strLine = new String[size];
        for (int i = 0; i < size; i++) {
            strLine[i] = nstr(sc);
        }
        return strLine;
    } strLine {
        String[] strLine = new String[size];
        for (int i = 0; i < size; i++) {
            strLine[i] = nstr(sc);
        }
        return strLine;
    } String[] strLine = new String[size]; strLine new String[size] size for (int i = 0; i < size; i++) {
            strLine[i] = nstr(sc);
        } int i = 0; int i = 0; i 0 i < size i size i++ i++ i {
            strLine[i] = nstr(sc);
        } {
            strLine[i] = nstr(sc);
        } strLine[i] = nstr(sc) strLine[i] strLine i nstr(sc) nstr sc return strLine; strLine Scanner sc sc int size size static class Task{
        public void solve(Scanner sc, PrintWriter out){
            int sum  = 0;
            int[] nint = intLine(sc, 3);
            Arrays.sort(nint);

            int a1 = nint[0];
            int a2 = nint[1];
            int a3 = nint[2];

            int a1a2 = Math.abs(a2-a1);
            int a1a3 = Math.abs(a3-a1);

            if (a1a2 <= a1a3){
                sum += a1a2 + Math.abs(a2-a3);
             }else {
                sum += a1a3 + Math.abs(a2-a3);
            }


            out.println(sum);

        }
    } Task public void solve(Scanner sc, PrintWriter out){
            int sum  = 0;
            int[] nint = intLine(sc, 3);
            Arrays.sort(nint);

            int a1 = nint[0];
            int a2 = nint[1];
            int a3 = nint[2];

            int a1a2 = Math.abs(a2-a1);
            int a1a3 = Math.abs(a3-a1);

            if (a1a2 <= a1a3){
                sum += a1a2 + Math.abs(a2-a3);
             }else {
                sum += a1a3 + Math.abs(a2-a3);
            }


            out.println(sum);

        } solve {
            int sum  = 0;
            int[] nint = intLine(sc, 3);
            Arrays.sort(nint);

            int a1 = nint[0];
            int a2 = nint[1];
            int a3 = nint[2];

            int a1a2 = Math.abs(a2-a1);
            int a1a3 = Math.abs(a3-a1);

            if (a1a2 <= a1a3){
                sum += a1a2 + Math.abs(a2-a3);
             }else {
                sum += a1a3 + Math.abs(a2-a3);
            }


            out.println(sum);

        } int sum  = 0; sum 0 int[] nint = intLine(sc, 3); nint intLine(sc, 3) intLine sc 3 Arrays.sort(nint) Arrays.sort Arrays nint int a1 = nint[0]; a1 nint[0] nint 0 int a2 = nint[1]; a2 nint[1] nint 1 int a3 = nint[2]; a3 nint[2] nint 2 int a1a2 = Math.abs(a2-a1); a1a2 Math.abs(a2-a1) Math.abs Math a2-a1 a2 a1 int a1a3 = Math.abs(a3-a1); a1a3 Math.abs(a3-a1) Math.abs Math a3-a1 a3 a1 if (a1a2 <= a1a3){
                sum += a1a2 + Math.abs(a2-a3);
             }else {
                sum += a1a3 + Math.abs(a2-a3);
            } a1a2 <= a1a3 a1a2 a1a3 {
                sum += a1a2 + Math.abs(a2-a3);
             } sum += a1a2 + Math.abs(a2-a3) sum a1a2 + Math.abs(a2-a3) a1a2 Math.abs(a2-a3) Math.abs Math a2-a3 a2 a3 {
                sum += a1a3 + Math.abs(a2-a3);
            } sum += a1a3 + Math.abs(a2-a3) sum a1a3 + Math.abs(a2-a3) a1a3 Math.abs(a2-a3) Math.abs Math a2-a3 a2 a3 out.println(sum) out.println out sum Scanner sc sc PrintWriter out out public class Main {
    public static void main(String[] args){
        PrintWriter out = new PrintWriter(System.out);
        Scanner sc = new Scanner(System.in);
        Task task = new Task();
        task.solve(sc, out);
        out.flush();
        sc.close();
    }
    static class Task{
        public void solve(Scanner sc, PrintWriter out){
            int sum  = 0;
            int[] nint = intLine(sc, 3);
            Arrays.sort(nint);

            int a1 = nint[0];
            int a2 = nint[1];
            int a3 = nint[2];

            int a1a2 = Math.abs(a2-a1);
            int a1a3 = Math.abs(a3-a1);

            if (a1a2 <= a1a3){
                sum += a1a2 + Math.abs(a2-a3);
             }else {
                sum += a1a3 + Math.abs(a2-a3);
            }


            out.println(sum);

        }
    }

    static int nint(Scanner sc){
        return Integer.parseInt(sc.next());
    }
    static long nlong(Scanner sc){
        return Long.parseLong(sc.next());
    }
    static double ndouble(Scanner sc){
        return Double.parseDouble(sc.next());
    }
    static float nfloat(Scanner sc){
        return Float.parseFloat(sc.next());
    }
    static String nstr(Scanner sc){
        return  String.valueOf(sc.next());
    }
    static long[] longLine(Scanner sc, int size){
        long[] lLine = new long[size];
        for (int i = 0; i < size; i++) {
            lLine[i] = nlong(sc);
        }
        return lLine;
    }
    static int[] intLine(Scanner sc, int size){
        int[] iLine = new int[size];
        for (int i = 0; i < size; i++) {
            iLine[i] = nint(sc);
        }
        return iLine;
    }
    static String[] strLine(Scanner sc, int size){
        String[] strLine = new String[size];
        for (int i = 0; i < size; i++) {
            strLine[i] = nstr(sc);
        }
        return strLine;
    }
} public class Main {
    public static void main(String[] args){
        PrintWriter out = new PrintWriter(System.out);
        Scanner sc = new Scanner(System.in);
        Task task = new Task();
        task.solve(sc, out);
        out.flush();
        sc.close();
    }
    static class Task{
        public void solve(Scanner sc, PrintWriter out){
            int sum  = 0;
            int[] nint = intLine(sc, 3);
            Arrays.sort(nint);

            int a1 = nint[0];
            int a2 = nint[1];
            int a3 = nint[2];

            int a1a2 = Math.abs(a2-a1);
            int a1a3 = Math.abs(a3-a1);

            if (a1a2 <= a1a3){
                sum += a1a2 + Math.abs(a2-a3);
             }else {
                sum += a1a3 + Math.abs(a2-a3);
            }


            out.println(sum);

        }
    }

    static int nint(Scanner sc){
        return Integer.parseInt(sc.next());
    }
    static long nlong(Scanner sc){
        return Long.parseLong(sc.next());
    }
    static double ndouble(Scanner sc){
        return Double.parseDouble(sc.next());
    }
    static float nfloat(Scanner sc){
        return Float.parseFloat(sc.next());
    }
    static String nstr(Scanner sc){
        return  String.valueOf(sc.next());
    }
    static long[] longLine(Scanner sc, int size){
        long[] lLine = new long[size];
        for (int i = 0; i < size; i++) {
            lLine[i] = nlong(sc);
        }
        return lLine;
    }
    static int[] intLine(Scanner sc, int size){
        int[] iLine = new int[size];
        for (int i = 0; i < size; i++) {
            iLine[i] = nint(sc);
        }
        return iLine;
    }
    static String[] strLine(Scanner sc, int size){
        String[] strLine = new String[size];
        for (int i = 0; i < size; i++) {
            strLine[i] = nstr(sc);
        }
        return strLine;
    }
} Main


import java.io.PrintWriter;
import java.util.Scanner;
import java.util.Arrays;
import java.util.List;

public class Main {
    public static void main(String[] args){
        PrintWriter out = new PrintWriter(System.out);
        Scanner sc = new Scanner(System.in);
        Task task = new Task();
        task.solve(sc, out);
        out.flush();
        sc.close();
    }
    static class Task{
        public void solve(Scanner sc, PrintWriter out){
            int sum  = 0;
            int[] nint = intLine(sc, 3);
            Arrays.sort(nint);

            int a1 = nint[0];
            int a2 = nint[1];
            int a3 = nint[2];

            int a1a2 = Math.abs(a2-a1);
            int a1a3 = Math.abs(a3-a1);

            if (a1a2 <= a1a3){
                sum += a1a2 + Math.abs(a2-a3);
             }else {
                sum += a1a3 + Math.abs(a2-a3);
            }


            out.println(sum);

        }
    }

    static int nint(Scanner sc){
        return Integer.parseInt(sc.next());
    }
    static long nlong(Scanner sc){
        return Long.parseLong(sc.next());
    }
    static double ndouble(Scanner sc){
        return Double.parseDouble(sc.next());
    }
    static float nfloat(Scanner sc){
        return Float.parseFloat(sc.next());
    }
    static String nstr(Scanner sc){
        return  String.valueOf(sc.next());
    }
    static long[] longLine(Scanner sc, int size){
        long[] lLine = new long[size];
        for (int i = 0; i < size; i++) {
            lLine[i] = nlong(sc);
        }
        return lLine;
    }
    static int[] intLine(Scanner sc, int size){
        int[] iLine = new int[size];
        for (int i = 0; i < size; i++) {
            iLine[i] = nint(sc);
        }
        return iLine;
    }
    static String[] strLine(Scanner sc, int size){
        String[] strLine = new String[size];
        for (int i = 0; i < size; i++) {
            strLine[i] = nstr(sc);
        }
        return strLine;
    }
}