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

public class Main{

    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
            int[] arr = new int[3];
            
            for(int i=0 ; i<3 ; i++){
                arr[i] = in.nextInt();
            }
            int sum1 = Math.abs(arr[0]-arr[1]) + Math.abs(arr[1] -arr[2]);
            int sum2 =  Math.abs(arr[0]-arr[2]) + Math.abs(arr[1] -arr[2]);
            int sum3 =  Math.abs(arr[1]-arr[0]) + Math.abs(arr[0] -arr[2]);
            int sum4 =  Math.abs(arr[1]-arr[2]) + Math.abs(arr[0] -arr[2]);
            int sum5 =  Math.abs(arr[2]-arr[0]) + Math.abs(arr[0] -arr[1]);
            int sum6 =  Math.abs(arr[2]-arr[1]) + Math.abs(arr[0] -arr[2]);
           


            int result = Math.min(sum1 , sum2);
            result = Math.min(result , sum3);
            result = Math.min(result , sum4);
            result = Math.min(result , sum5);
            result = Math.min(result , sum6);
            
           System.out.println(result);
        }
    } import java.util.*; util.* java import java.io.*; io.* java public class Main{

    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
            int[] arr = new int[3];
            
            for(int i=0 ; i<3 ; i++){
                arr[i] = in.nextInt();
            }
            int sum1 = Math.abs(arr[0]-arr[1]) + Math.abs(arr[1] -arr[2]);
            int sum2 =  Math.abs(arr[0]-arr[2]) + Math.abs(arr[1] -arr[2]);
            int sum3 =  Math.abs(arr[1]-arr[0]) + Math.abs(arr[0] -arr[2]);
            int sum4 =  Math.abs(arr[1]-arr[2]) + Math.abs(arr[0] -arr[2]);
            int sum5 =  Math.abs(arr[2]-arr[0]) + Math.abs(arr[0] -arr[1]);
            int sum6 =  Math.abs(arr[2]-arr[1]) + Math.abs(arr[0] -arr[2]);
           


            int result = Math.min(sum1 , sum2);
            result = Math.min(result , sum3);
            result = Math.min(result , sum4);
            result = Math.min(result , sum5);
            result = Math.min(result , sum6);
            
           System.out.println(result);
        }
    } Main public static void main(String[] args){
        Scanner in = new Scanner(System.in);
            int[] arr = new int[3];
            
            for(int i=0 ; i<3 ; i++){
                arr[i] = in.nextInt();
            }
            int sum1 = Math.abs(arr[0]-arr[1]) + Math.abs(arr[1] -arr[2]);
            int sum2 =  Math.abs(arr[0]-arr[2]) + Math.abs(arr[1] -arr[2]);
            int sum3 =  Math.abs(arr[1]-arr[0]) + Math.abs(arr[0] -arr[2]);
            int sum4 =  Math.abs(arr[1]-arr[2]) + Math.abs(arr[0] -arr[2]);
            int sum5 =  Math.abs(arr[2]-arr[0]) + Math.abs(arr[0] -arr[1]);
            int sum6 =  Math.abs(arr[2]-arr[1]) + Math.abs(arr[0] -arr[2]);
           


            int result = Math.min(sum1 , sum2);
            result = Math.min(result , sum3);
            result = Math.min(result , sum4);
            result = Math.min(result , sum5);
            result = Math.min(result , sum6);
            
           System.out.println(result);
        } main {
        Scanner in = new Scanner(System.in);
            int[] arr = new int[3];
            
            for(int i=0 ; i<3 ; i++){
                arr[i] = in.nextInt();
            }
            int sum1 = Math.abs(arr[0]-arr[1]) + Math.abs(arr[1] -arr[2]);
            int sum2 =  Math.abs(arr[0]-arr[2]) + Math.abs(arr[1] -arr[2]);
            int sum3 =  Math.abs(arr[1]-arr[0]) + Math.abs(arr[0] -arr[2]);
            int sum4 =  Math.abs(arr[1]-arr[2]) + Math.abs(arr[0] -arr[2]);
            int sum5 =  Math.abs(arr[2]-arr[0]) + Math.abs(arr[0] -arr[1]);
            int sum6 =  Math.abs(arr[2]-arr[1]) + Math.abs(arr[0] -arr[2]);
           


            int result = Math.min(sum1 , sum2);
            result = Math.min(result , sum3);
            result = Math.min(result , sum4);
            result = Math.min(result , sum5);
            result = Math.min(result , sum6);
            
           System.out.println(result);
        } Scanner in = new Scanner(System.in); in new Scanner(System.in) int[] arr = new int[3]; arr new int[3] 3 for(int i=0 ; i<3 ; i++){
                arr[i] = in.nextInt();
            } int i=0 ; int i=0 ; i 0 i<3 i 3 i++ i++ i {
                arr[i] = in.nextInt();
            } {
                arr[i] = in.nextInt();
            } arr[i] = in.nextInt() arr[i] arr i in.nextInt() in.nextInt in int sum1 = Math.abs(arr[0]-arr[1]) + Math.abs(arr[1] -arr[2]); sum1 Math.abs(arr[0]-arr[1]) + Math.abs(arr[1] -arr[2]) Math.abs(arr[0]-arr[1]) Math.abs Math arr[0]-arr[1] arr[0] arr 0 arr[1] arr 1 Math.abs(arr[1] -arr[2]) Math.abs Math arr[1] -arr[2] arr[1] arr 1 arr[2] arr 2 int sum2 =  Math.abs(arr[0]-arr[2]) + Math.abs(arr[1] -arr[2]); sum2 Math.abs(arr[0]-arr[2]) + Math.abs(arr[1] -arr[2]) Math.abs(arr[0]-arr[2]) Math.abs Math arr[0]-arr[2] arr[0] arr 0 arr[2] arr 2 Math.abs(arr[1] -arr[2]) Math.abs Math arr[1] -arr[2] arr[1] arr 1 arr[2] arr 2 int sum3 =  Math.abs(arr[1]-arr[0]) + Math.abs(arr[0] -arr[2]); sum3 Math.abs(arr[1]-arr[0]) + Math.abs(arr[0] -arr[2]) Math.abs(arr[1]-arr[0]) Math.abs Math arr[1]-arr[0] arr[1] arr 1 arr[0] arr 0 Math.abs(arr[0] -arr[2]) Math.abs Math arr[0] -arr[2] arr[0] arr 0 arr[2] arr 2 int sum4 =  Math.abs(arr[1]-arr[2]) + Math.abs(arr[0] -arr[2]); sum4 Math.abs(arr[1]-arr[2]) + Math.abs(arr[0] -arr[2]) Math.abs(arr[1]-arr[2]) Math.abs Math arr[1]-arr[2] arr[1] arr 1 arr[2] arr 2 Math.abs(arr[0] -arr[2]) Math.abs Math arr[0] -arr[2] arr[0] arr 0 arr[2] arr 2 int sum5 =  Math.abs(arr[2]-arr[0]) + Math.abs(arr[0] -arr[1]); sum5 Math.abs(arr[2]-arr[0]) + Math.abs(arr[0] -arr[1]) Math.abs(arr[2]-arr[0]) Math.abs Math arr[2]-arr[0] arr[2] arr 2 arr[0] arr 0 Math.abs(arr[0] -arr[1]) Math.abs Math arr[0] -arr[1] arr[0] arr 0 arr[1] arr 1 int sum6 =  Math.abs(arr[2]-arr[1]) + Math.abs(arr[0] -arr[2]); sum6 Math.abs(arr[2]-arr[1]) + Math.abs(arr[0] -arr[2]) Math.abs(arr[2]-arr[1]) Math.abs Math arr[2]-arr[1] arr[2] arr 2 arr[1] arr 1 Math.abs(arr[0] -arr[2]) Math.abs Math arr[0] -arr[2] arr[0] arr 0 arr[2] arr 2 int result = Math.min(sum1 , sum2); result Math.min(sum1 , sum2) Math.min Math sum1 sum2 result = Math.min(result , sum3) result Math.min(result , sum3) Math.min Math result sum3 result = Math.min(result , sum4) result Math.min(result , sum4) Math.min Math result sum4 result = Math.min(result , sum5) result Math.min(result , sum5) Math.min Math result sum5 result = Math.min(result , sum6) result Math.min(result , sum6) Math.min Math result sum6 System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main{

    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
            int[] arr = new int[3];
            
            for(int i=0 ; i<3 ; i++){
                arr[i] = in.nextInt();
            }
            int sum1 = Math.abs(arr[0]-arr[1]) + Math.abs(arr[1] -arr[2]);
            int sum2 =  Math.abs(arr[0]-arr[2]) + Math.abs(arr[1] -arr[2]);
            int sum3 =  Math.abs(arr[1]-arr[0]) + Math.abs(arr[0] -arr[2]);
            int sum4 =  Math.abs(arr[1]-arr[2]) + Math.abs(arr[0] -arr[2]);
            int sum5 =  Math.abs(arr[2]-arr[0]) + Math.abs(arr[0] -arr[1]);
            int sum6 =  Math.abs(arr[2]-arr[1]) + Math.abs(arr[0] -arr[2]);
           


            int result = Math.min(sum1 , sum2);
            result = Math.min(result , sum3);
            result = Math.min(result , sum4);
            result = Math.min(result , sum5);
            result = Math.min(result , sum6);
            
           System.out.println(result);
        }
    } public class Main{

    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
            int[] arr = new int[3];
            
            for(int i=0 ; i<3 ; i++){
                arr[i] = in.nextInt();
            }
            int sum1 = Math.abs(arr[0]-arr[1]) + Math.abs(arr[1] -arr[2]);
            int sum2 =  Math.abs(arr[0]-arr[2]) + Math.abs(arr[1] -arr[2]);
            int sum3 =  Math.abs(arr[1]-arr[0]) + Math.abs(arr[0] -arr[2]);
            int sum4 =  Math.abs(arr[1]-arr[2]) + Math.abs(arr[0] -arr[2]);
            int sum5 =  Math.abs(arr[2]-arr[0]) + Math.abs(arr[0] -arr[1]);
            int sum6 =  Math.abs(arr[2]-arr[1]) + Math.abs(arr[0] -arr[2]);
           


            int result = Math.min(sum1 , sum2);
            result = Math.min(result , sum3);
            result = Math.min(result , sum4);
            result = Math.min(result , sum5);
            result = Math.min(result , sum6);
            
           System.out.println(result);
        }
    } Main
import java.util.*;
import java.io.*;

public class Main{

    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
            int[] arr = new int[3];
            
            for(int i=0 ; i<3 ; i++){
                arr[i] = in.nextInt();
            }
            int sum1 = Math.abs(arr[0]-arr[1]) + Math.abs(arr[1] -arr[2]);
            int sum2 =  Math.abs(arr[0]-arr[2]) + Math.abs(arr[1] -arr[2]);
            int sum3 =  Math.abs(arr[1]-arr[0]) + Math.abs(arr[0] -arr[2]);
            int sum4 =  Math.abs(arr[1]-arr[2]) + Math.abs(arr[0] -arr[2]);
            int sum5 =  Math.abs(arr[2]-arr[0]) + Math.abs(arr[0] -arr[1]);
            int sum6 =  Math.abs(arr[2]-arr[1]) + Math.abs(arr[0] -arr[2]);
           


            int result = Math.min(sum1 , sum2);
            result = Math.min(result , sum3);
            result = Math.min(result , sum4);
            result = Math.min(result , sum5);
            result = Math.min(result , sum6);
            
           System.out.println(result);
        }
    }
