import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.util.*;

public class Main {

    //グローバル変数を定義

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

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

        int[] array = new int[3];

        array[0] = a;
        array[1] = b;
        array[2] = c;

        Arrays.sort(array);

        int cost = 0;
        for(int i=0; i<array.length-1; i++){
            int before = array[i];
            int newCost = Math.abs(before - array[i+1]);
            cost+=newCost;
        }

        System.out.println(cost);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.math.BigDecimal; BigDecimal java.math import java.nio.charset.StandardCharsets; StandardCharsets java.nio.charset import java.util.*; util.* java public class Main {

    //グローバル変数を定義

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

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

        int[] array = new int[3];

        array[0] = a;
        array[1] = b;
        array[2] = c;

        Arrays.sort(array);

        int cost = 0;
        for(int i=0; i<array.length-1; i++){
            int before = array[i];
            int newCost = Math.abs(before - array[i+1]);
            cost+=newCost;
        }

        System.out.println(cost);
    }
} Main public static void main(String[] args) throws IOException {
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args void run() {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();

        int[] array = new int[3];

        array[0] = a;
        array[1] = b;
        array[2] = c;

        Arrays.sort(array);

        int cost = 0;
        for(int i=0; i<array.length-1; i++){
            int before = array[i];
            int newCost = Math.abs(before - array[i+1]);
            cost+=newCost;
        }

        System.out.println(cost);
    } run {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();

        int[] array = new int[3];

        array[0] = a;
        array[1] = b;
        array[2] = c;

        Arrays.sort(array);

        int cost = 0;
        for(int i=0; i<array.length-1; i++){
            int before = array[i];
            int newCost = Math.abs(before - array[i+1]);
            cost+=newCost;
        }

        System.out.println(cost);
    } Scanner sc = new Scanner(System.in); sc 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[] array = new int[3]; array new int[3] 3 array[0] = a array[0] array 0 a array[1] = b array[1] array 1 b array[2] = c array[2] array 2 c Arrays.sort(array) Arrays.sort Arrays array int cost = 0; cost 0 for(int i=0; i<array.length-1; i++){
            int before = array[i];
            int newCost = Math.abs(before - array[i+1]);
            cost+=newCost;
        } int i=0; int i=0; i 0 i<array.length-1 i array.length-1 array.length array array.length 1 i++ i++ i {
            int before = array[i];
            int newCost = Math.abs(before - array[i+1]);
            cost+=newCost;
        } {
            int before = array[i];
            int newCost = Math.abs(before - array[i+1]);
            cost+=newCost;
        } int before = array[i]; before array[i] array i int newCost = Math.abs(before - array[i+1]); newCost Math.abs(before - array[i+1]) Math.abs Math before - array[i+1] before array[i+1] array i+1 i 1 cost+=newCost cost newCost System.out.println(cost) System.out.println System.out System System.out cost public class Main {

    //グローバル変数を定義

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

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

        int[] array = new int[3];

        array[0] = a;
        array[1] = b;
        array[2] = c;

        Arrays.sort(array);

        int cost = 0;
        for(int i=0; i<array.length-1; i++){
            int before = array[i];
            int newCost = Math.abs(before - array[i+1]);
            cost+=newCost;
        }

        System.out.println(cost);
    }
} public class Main {

    //グローバル変数を定義

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

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

        int[] array = new int[3];

        array[0] = a;
        array[1] = b;
        array[2] = c;

        Arrays.sort(array);

        int cost = 0;
        for(int i=0; i<array.length-1; i++){
            int before = array[i];
            int newCost = Math.abs(before - array[i+1]);
            cost+=newCost;
        }

        System.out.println(cost);
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.util.*;

public class Main {

    //グローバル変数を定義

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

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

        int[] array = new int[3];

        array[0] = a;
        array[1] = b;
        array[2] = c;

        Arrays.sort(array);

        int cost = 0;
        for(int i=0; i<array.length-1; i++){
            int before = array[i];
            int newCost = Math.abs(before - array[i+1]);
            cost+=newCost;
        }

        System.out.println(cost);
    }
}
