import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

    static int[] A;

    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);
        A = sc.nextIntArray(3);
        System.out.println( solve() );
    }


    static int solve() {
        return min(cost(0, 1, 2), cost(0, 2, 1), cost(1, 0, 2), cost(1, 2, 0), cost(2, 0, 1), cost(2, 1, 0));
    }

    static int cost(int a, int b, int c) {
        return Math.abs(A[b] - A[a]) + Math.abs(A[c] - A[b]);
    }

    static int min(int... cs) {
        int min = 200;
        for (int c : cs) {
            min = Math.min(min, c);
        }
        return min;
    }

    @SuppressWarnings("unused")
    static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;
        FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }
        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken("\n");
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }
        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util import java.util.StringTokenizer; StringTokenizer java.util public class Main {

    static int[] A;

    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);
        A = sc.nextIntArray(3);
        System.out.println( solve() );
    }


    static int solve() {
        return min(cost(0, 1, 2), cost(0, 2, 1), cost(1, 0, 2), cost(1, 2, 0), cost(2, 0, 1), cost(2, 1, 0));
    }

    static int cost(int a, int b, int c) {
        return Math.abs(A[b] - A[a]) + Math.abs(A[c] - A[b]);
    }

    static int min(int... cs) {
        int min = 200;
        for (int c : cs) {
            min = Math.min(min, c);
        }
        return min;
    }

    @SuppressWarnings("unused")
    static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;
        FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }
        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken("\n");
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }
        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
} Main static int[] A; A public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);
        A = sc.nextIntArray(3);
        System.out.println( solve() );
    } main {
        FastScanner sc = new FastScanner(System.in);
        A = sc.nextIntArray(3);
        System.out.println( solve() );
    } FastScanner sc = new FastScanner(System.in); sc new FastScanner(System.in) A = sc.nextIntArray(3) A sc.nextIntArray(3) sc.nextIntArray sc 3 System.out.println( solve() ) System.out.println System.out System System.out solve() solve String[] args args static int solve() {
        return min(cost(0, 1, 2), cost(0, 2, 1), cost(1, 0, 2), cost(1, 2, 0), cost(2, 0, 1), cost(2, 1, 0));
    } solve {
        return min(cost(0, 1, 2), cost(0, 2, 1), cost(1, 0, 2), cost(1, 2, 0), cost(2, 0, 1), cost(2, 1, 0));
    } return min(cost(0, 1, 2), cost(0, 2, 1), cost(1, 0, 2), cost(1, 2, 0), cost(2, 0, 1), cost(2, 1, 0)); min(cost(0, 1, 2), cost(0, 2, 1), cost(1, 0, 2), cost(1, 2, 0), cost(2, 0, 1), cost(2, 1, 0)) min cost(0, 1, 2) cost 0 1 2 cost(0, 2, 1) cost 0 2 1 cost(1, 0, 2) cost 1 0 2 cost(1, 2, 0) cost 1 2 0 cost(2, 0, 1) cost 2 0 1 cost(2, 1, 0) cost 2 1 0 static int cost(int a, int b, int c) {
        return Math.abs(A[b] - A[a]) + Math.abs(A[c] - A[b]);
    } cost {
        return Math.abs(A[b] - A[a]) + Math.abs(A[c] - A[b]);
    } return Math.abs(A[b] - A[a]) + Math.abs(A[c] - A[b]); Math.abs(A[b] - A[a]) + Math.abs(A[c] - A[b]) Math.abs(A[b] - A[a]) Math.abs Math A[b] - A[a] A[b] A b A[a] A a Math.abs(A[c] - A[b]) Math.abs Math A[c] - A[b] A[c] A c A[b] A b int a a int b b int c c static int min(int... cs) {
        int min = 200;
        for (int c : cs) {
            min = Math.min(min, c);
        }
        return min;
    } min {
        int min = 200;
        for (int c : cs) {
            min = Math.min(min, c);
        }
        return min;
    } int min = 200; min 200 for (int c : cs) {
            min = Math.min(min, c);
        } int c cs {
            min = Math.min(min, c);
        } {
            min = Math.min(min, c);
        } min = Math.min(min, c) min Math.min(min, c) Math.min Math min c return min; min int... cs cs static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;
        FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }
        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken("\n");
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }
        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    } FastScanner private BufferedReader reader; reader private StringTokenizer tokenizer; tokenizer FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        } FastScanner {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        } reader = new BufferedReader(new InputStreamReader(in)) reader new BufferedReader(new InputStreamReader(in)) tokenizer = null tokenizer null InputStream in in String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        } next {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        } if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            } tokenizer == null || !tokenizer.hasMoreTokens() tokenizer == null tokenizer null !tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            } try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                } IOException e {
                    throw new RuntimeException(e);
                } throw new RuntimeException(e); new RuntimeException(e) {
                    tokenizer = new StringTokenizer(reader.readLine());
                } tokenizer = new StringTokenizer(reader.readLine()) tokenizer new StringTokenizer(reader.readLine()) return tokenizer.nextToken(); tokenizer.nextToken() tokenizer.nextToken tokenizer String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken("\n");
        } nextLine {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken("\n");
        } if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            } tokenizer == null || !tokenizer.hasMoreTokens() tokenizer == null tokenizer null !tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            } try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                } IOException e {
                    throw new RuntimeException(e);
                } throw new RuntimeException(e); new RuntimeException(e) {
                    return reader.readLine();
                } return reader.readLine(); reader.readLine() reader.readLine reader return tokenizer.nextToken("\n"); tokenizer.nextToken("\n") tokenizer.nextToken tokenizer "\n" long nextLong() {
            return Long.parseLong(next());
        } nextLong {
            return Long.parseLong(next());
        } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next int nextInt() {
            return Integer.parseInt(next());
        } nextInt {
            return Integer.parseInt(next());
        } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        } nextIntArray {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        } int[] a = new int[n]; a new int[n] n for (int i = 0; i < n; i++)
                a[i] = nextInt(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i a[i] = nextInt(); a[i] = nextInt() a[i] a i nextInt() nextInt return a; a int n n long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        } nextLongArray {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        } long[] a = new long[n]; a new long[n] n for (int i = 0; i < n; i++)
                a[i] = nextLong(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i a[i] = nextLong(); a[i] = nextLong() a[i] a i nextLong() nextLong return a; a int n n public class Main {

    static int[] A;

    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);
        A = sc.nextIntArray(3);
        System.out.println( solve() );
    }


    static int solve() {
        return min(cost(0, 1, 2), cost(0, 2, 1), cost(1, 0, 2), cost(1, 2, 0), cost(2, 0, 1), cost(2, 1, 0));
    }

    static int cost(int a, int b, int c) {
        return Math.abs(A[b] - A[a]) + Math.abs(A[c] - A[b]);
    }

    static int min(int... cs) {
        int min = 200;
        for (int c : cs) {
            min = Math.min(min, c);
        }
        return min;
    }

    @SuppressWarnings("unused")
    static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;
        FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }
        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken("\n");
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }
        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
} public class Main {

    static int[] A;

    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);
        A = sc.nextIntArray(3);
        System.out.println( solve() );
    }


    static int solve() {
        return min(cost(0, 1, 2), cost(0, 2, 1), cost(1, 0, 2), cost(1, 2, 0), cost(2, 0, 1), cost(2, 1, 0));
    }

    static int cost(int a, int b, int c) {
        return Math.abs(A[b] - A[a]) + Math.abs(A[c] - A[b]);
    }

    static int min(int... cs) {
        int min = 200;
        for (int c : cs) {
            min = Math.min(min, c);
        }
        return min;
    }

    @SuppressWarnings("unused")
    static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;
        FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }
        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken("\n");
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }
        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

    static int[] A;

    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);
        A = sc.nextIntArray(3);
        System.out.println( solve() );
    }


    static int solve() {
        return min(cost(0, 1, 2), cost(0, 2, 1), cost(1, 0, 2), cost(1, 2, 0), cost(2, 0, 1), cost(2, 1, 0));
    }

    static int cost(int a, int b, int c) {
        return Math.abs(A[b] - A[a]) + Math.abs(A[c] - A[b]);
    }

    static int min(int... cs) {
        int min = 200;
        for (int c : cs) {
            min = Math.min(min, c);
        }
        return min;
    }

    @SuppressWarnings("unused")
    static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;
        FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }
        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken("\n");
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }
        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
}
