/**
 * TODO: delete this line
 */


import java.util.Scanner;

/**
 * TODO: Rename to Main
 */
class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] As = new int[3];
        for (int i = 0; i < 3; i++) {
            As[i] = scanner.nextInt();
        }
        int min = 1000;
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                for (int h = 0; h < 3; h++) {
                    if (j!= i && h != i && h != j) {
                        int temp = Math.abs(As[i] - As[j]) + Math.abs(As[j] - As[h]);
                        if (temp < min) {
                            min = temp;
                        }
                    }
                }
            }
        }

        System.out.println(min);
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] As = new int[3];
        for (int i = 0; i < 3; i++) {
            As[i] = scanner.nextInt();
        }
        int min = 1000;
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                for (int h = 0; h < 3; h++) {
                    if (j!= i && h != i && h != j) {
                        int temp = Math.abs(As[i] - As[j]) + Math.abs(As[j] - As[h]);
                        if (temp < min) {
                            min = temp;
                        }
                    }
                }
            }
        }

        System.out.println(min);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] As = new int[3];
        for (int i = 0; i < 3; i++) {
            As[i] = scanner.nextInt();
        }
        int min = 1000;
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                for (int h = 0; h < 3; h++) {
                    if (j!= i && h != i && h != j) {
                        int temp = Math.abs(As[i] - As[j]) + Math.abs(As[j] - As[h]);
                        if (temp < min) {
                            min = temp;
                        }
                    }
                }
            }
        }

        System.out.println(min);
    } main {
        Scanner scanner = new Scanner(System.in);
        int[] As = new int[3];
        for (int i = 0; i < 3; i++) {
            As[i] = scanner.nextInt();
        }
        int min = 1000;
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                for (int h = 0; h < 3; h++) {
                    if (j!= i && h != i && h != j) {
                        int temp = Math.abs(As[i] - As[j]) + Math.abs(As[j] - As[h]);
                        if (temp < min) {
                            min = temp;
                        }
                    }
                }
            }
        }

        System.out.println(min);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int[] As = new int[3]; As new int[3] 3 for (int i = 0; i < 3; i++) {
            As[i] = scanner.nextInt();
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            As[i] = scanner.nextInt();
        } {
            As[i] = scanner.nextInt();
        } As[i] = scanner.nextInt() As[i] As i scanner.nextInt() scanner.nextInt scanner int min = 1000; min 1000 for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                for (int h = 0; h < 3; h++) {
                    if (j!= i && h != i && h != j) {
                        int temp = Math.abs(As[i] - As[j]) + Math.abs(As[j] - As[h]);
                        if (temp < min) {
                            min = temp;
                        }
                    }
                }
            }
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            for (int j = 0; j < 3; j++) {
                for (int h = 0; h < 3; h++) {
                    if (j!= i && h != i && h != j) {
                        int temp = Math.abs(As[i] - As[j]) + Math.abs(As[j] - As[h]);
                        if (temp < min) {
                            min = temp;
                        }
                    }
                }
            }
        } {
            for (int j = 0; j < 3; j++) {
                for (int h = 0; h < 3; h++) {
                    if (j!= i && h != i && h != j) {
                        int temp = Math.abs(As[i] - As[j]) + Math.abs(As[j] - As[h]);
                        if (temp < min) {
                            min = temp;
                        }
                    }
                }
            }
        } for (int j = 0; j < 3; j++) {
                for (int h = 0; h < 3; h++) {
                    if (j!= i && h != i && h != j) {
                        int temp = Math.abs(As[i] - As[j]) + Math.abs(As[j] - As[h]);
                        if (temp < min) {
                            min = temp;
                        }
                    }
                }
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                for (int h = 0; h < 3; h++) {
                    if (j!= i && h != i && h != j) {
                        int temp = Math.abs(As[i] - As[j]) + Math.abs(As[j] - As[h]);
                        if (temp < min) {
                            min = temp;
                        }
                    }
                }
            } {
                for (int h = 0; h < 3; h++) {
                    if (j!= i && h != i && h != j) {
                        int temp = Math.abs(As[i] - As[j]) + Math.abs(As[j] - As[h]);
                        if (temp < min) {
                            min = temp;
                        }
                    }
                }
            } for (int h = 0; h < 3; h++) {
                    if (j!= i && h != i && h != j) {
                        int temp = Math.abs(As[i] - As[j]) + Math.abs(As[j] - As[h]);
                        if (temp < min) {
                            min = temp;
                        }
                    }
                } int h = 0; int h = 0; h 0 h < 3 h 3 h++ h++ h {
                    if (j!= i && h != i && h != j) {
                        int temp = Math.abs(As[i] - As[j]) + Math.abs(As[j] - As[h]);
                        if (temp < min) {
                            min = temp;
                        }
                    }
                } {
                    if (j!= i && h != i && h != j) {
                        int temp = Math.abs(As[i] - As[j]) + Math.abs(As[j] - As[h]);
                        if (temp < min) {
                            min = temp;
                        }
                    }
                } if (j!= i && h != i && h != j) {
                        int temp = Math.abs(As[i] - As[j]) + Math.abs(As[j] - As[h]);
                        if (temp < min) {
                            min = temp;
                        }
                    } j!= i && h != i && h != j j!= i && h != i && h != j j!= i j i h != i h i h != j h j {
                        int temp = Math.abs(As[i] - As[j]) + Math.abs(As[j] - As[h]);
                        if (temp < min) {
                            min = temp;
                        }
                    } int temp = Math.abs(As[i] - As[j]) + Math.abs(As[j] - As[h]); temp Math.abs(As[i] - As[j]) + Math.abs(As[j] - As[h]) Math.abs(As[i] - As[j]) Math.abs Math As[i] - As[j] As[i] As i As[j] As j Math.abs(As[j] - As[h]) Math.abs Math As[j] - As[h] As[j] As j As[h] As h if (temp < min) {
                            min = temp;
                        } temp < min temp min {
                            min = temp;
                        } min = temp min temp System.out.println(min) System.out.println System.out System System.out min String[] args args
/**
 * TODO: delete this line
 */


import java.util.Scanner;

/**
 * TODO: Rename to Main
 */
class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] As = new int[3];
        for (int i = 0; i < 3; i++) {
            As[i] = scanner.nextInt();
        }
        int min = 1000;
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                for (int h = 0; h < 3; h++) {
                    if (j!= i && h != i && h != j) {
                        int temp = Math.abs(As[i] - As[j]) + Math.abs(As[j] - As[h]);
                        if (temp < min) {
                            min = temp;
                        }
                    }
                }
            }
        }

        System.out.println(min);
    }
}