import java.io.*;
import java.util.*;

public class Main{
  public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int[] As = new int[3];
        As[0] = scanner.nextInt();
        As[1] = scanner.nextInt();
        As[2] = scanner.nextInt();

        int bestCost = 99999;
        for(int i = 0; i < 3;i++){

            for(int j = 0; j < 3;j++){
                if(j == i) continue;
                int sum = 3 - i - j;
                int a = Math.abs(As[j] - As[i]);
                a+=  Math.abs(As[sum] - As[j]);
                if(a < bestCost){
                    bestCost = a;
                }
            }

        }
        System.out.println(bestCost);
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main{
  public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int[] As = new int[3];
        As[0] = scanner.nextInt();
        As[1] = scanner.nextInt();
        As[2] = scanner.nextInt();

        int bestCost = 99999;
        for(int i = 0; i < 3;i++){

            for(int j = 0; j < 3;j++){
                if(j == i) continue;
                int sum = 3 - i - j;
                int a = Math.abs(As[j] - As[i]);
                a+=  Math.abs(As[sum] - As[j]);
                if(a < bestCost){
                    bestCost = a;
                }
            }

        }
        System.out.println(bestCost);
    }
} Main public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int[] As = new int[3];
        As[0] = scanner.nextInt();
        As[1] = scanner.nextInt();
        As[2] = scanner.nextInt();

        int bestCost = 99999;
        for(int i = 0; i < 3;i++){

            for(int j = 0; j < 3;j++){
                if(j == i) continue;
                int sum = 3 - i - j;
                int a = Math.abs(As[j] - As[i]);
                a+=  Math.abs(As[sum] - As[j]);
                if(a < bestCost){
                    bestCost = a;
                }
            }

        }
        System.out.println(bestCost);
    } main {
        Scanner scanner = new Scanner(System.in);
        int[] As = new int[3];
        As[0] = scanner.nextInt();
        As[1] = scanner.nextInt();
        As[2] = scanner.nextInt();

        int bestCost = 99999;
        for(int i = 0; i < 3;i++){

            for(int j = 0; j < 3;j++){
                if(j == i) continue;
                int sum = 3 - i - j;
                int a = Math.abs(As[j] - As[i]);
                a+=  Math.abs(As[sum] - As[j]);
                if(a < bestCost){
                    bestCost = a;
                }
            }

        }
        System.out.println(bestCost);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int[] As = new int[3]; As new int[3] 3 As[0] = scanner.nextInt() As[0] As 0 scanner.nextInt() scanner.nextInt scanner As[1] = scanner.nextInt() As[1] As 1 scanner.nextInt() scanner.nextInt scanner As[2] = scanner.nextInt() As[2] As 2 scanner.nextInt() scanner.nextInt scanner int bestCost = 99999; bestCost 99999 for(int i = 0; i < 3;i++){

            for(int j = 0; j < 3;j++){
                if(j == i) continue;
                int sum = 3 - i - j;
                int a = Math.abs(As[j] - As[i]);
                a+=  Math.abs(As[sum] - As[j]);
                if(a < bestCost){
                    bestCost = a;
                }
            }

        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {

            for(int j = 0; j < 3;j++){
                if(j == i) continue;
                int sum = 3 - i - j;
                int a = Math.abs(As[j] - As[i]);
                a+=  Math.abs(As[sum] - As[j]);
                if(a < bestCost){
                    bestCost = a;
                }
            }

        } {

            for(int j = 0; j < 3;j++){
                if(j == i) continue;
                int sum = 3 - i - j;
                int a = Math.abs(As[j] - As[i]);
                a+=  Math.abs(As[sum] - As[j]);
                if(a < bestCost){
                    bestCost = a;
                }
            }

        } for(int j = 0; j < 3;j++){
                if(j == i) continue;
                int sum = 3 - i - j;
                int a = Math.abs(As[j] - As[i]);
                a+=  Math.abs(As[sum] - As[j]);
                if(a < bestCost){
                    bestCost = a;
                }
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                if(j == i) continue;
                int sum = 3 - i - j;
                int a = Math.abs(As[j] - As[i]);
                a+=  Math.abs(As[sum] - As[j]);
                if(a < bestCost){
                    bestCost = a;
                }
            } {
                if(j == i) continue;
                int sum = 3 - i - j;
                int a = Math.abs(As[j] - As[i]);
                a+=  Math.abs(As[sum] - As[j]);
                if(a < bestCost){
                    bestCost = a;
                }
            } if(j == i) continue; j == i j i continue; int sum = 3 - i - j; sum 3 - i - j 3 - i - j 3 i j int a = Math.abs(As[j] - As[i]); a Math.abs(As[j] - As[i]) Math.abs Math As[j] - As[i] As[j] As j As[i] As i a+=  Math.abs(As[sum] - As[j]) a Math.abs(As[sum] - As[j]) Math.abs Math As[sum] - As[j] As[sum] As sum As[j] As j if(a < bestCost){
                    bestCost = a;
                } a < bestCost a bestCost {
                    bestCost = a;
                } bestCost = a bestCost a System.out.println(bestCost) System.out.println System.out System System.out bestCost String[] args args public class Main{
  public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int[] As = new int[3];
        As[0] = scanner.nextInt();
        As[1] = scanner.nextInt();
        As[2] = scanner.nextInt();

        int bestCost = 99999;
        for(int i = 0; i < 3;i++){

            for(int j = 0; j < 3;j++){
                if(j == i) continue;
                int sum = 3 - i - j;
                int a = Math.abs(As[j] - As[i]);
                a+=  Math.abs(As[sum] - As[j]);
                if(a < bestCost){
                    bestCost = a;
                }
            }

        }
        System.out.println(bestCost);
    }
} public class Main{
  public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int[] As = new int[3];
        As[0] = scanner.nextInt();
        As[1] = scanner.nextInt();
        As[2] = scanner.nextInt();

        int bestCost = 99999;
        for(int i = 0; i < 3;i++){

            for(int j = 0; j < 3;j++){
                if(j == i) continue;
                int sum = 3 - i - j;
                int a = Math.abs(As[j] - As[i]);
                a+=  Math.abs(As[sum] - As[j]);
                if(a < bestCost){
                    bestCost = a;
                }
            }

        }
        System.out.println(bestCost);
    }
} Main
import java.io.*;
import java.util.*;

public class Main{
  public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int[] As = new int[3];
        As[0] = scanner.nextInt();
        As[1] = scanner.nextInt();
        As[2] = scanner.nextInt();

        int bestCost = 99999;
        for(int i = 0; i < 3;i++){

            for(int j = 0; j < 3;j++){
                if(j == i) continue;
                int sum = 3 - i - j;
                int a = Math.abs(As[j] - As[i]);
                a+=  Math.abs(As[sum] - As[j]);
                if(a < bestCost){
                    bestCost = a;
                }
            }

        }
        System.out.println(bestCost);
    }
}