import java.util.Scanner;
public class Main{
    
    public static int cost(int a,int b,int c){
        int cost = 0;
        cost = cost + Math.abs(b-a) + Math.abs(c-b);
        
        return(cost);   
    }

     public static void main(String []args){
         int A=0; int B=0;int C=0;
         Scanner in = new Scanner(System.in);
         A = Integer.parseInt(in.next());
         B = Integer.parseInt(in.next());
         C = Integer.parseInt(in.next());
         in.close();
        
        int[] costSum = new int[6];
        costSum[0] = cost(A,B,C);
        costSum[1] = cost(A,C,B);
        costSum[2] = cost(B,A,C);
        costSum[3] = cost(B,C,A);
        costSum[4] = cost(C,A,B);
        costSum[5] = cost(C,B,A);
         int min = costSum[0];
         for (int i=0;i<costSum.length;i++){
             if(min > costSum[i]){
                 min = costSum[i];
             }
         }
         System.out.println(min);
     }
} import java.util.Scanner; Scanner java.util public class Main{
    
    public static int cost(int a,int b,int c){
        int cost = 0;
        cost = cost + Math.abs(b-a) + Math.abs(c-b);
        
        return(cost);   
    }

     public static void main(String []args){
         int A=0; int B=0;int C=0;
         Scanner in = new Scanner(System.in);
         A = Integer.parseInt(in.next());
         B = Integer.parseInt(in.next());
         C = Integer.parseInt(in.next());
         in.close();
        
        int[] costSum = new int[6];
        costSum[0] = cost(A,B,C);
        costSum[1] = cost(A,C,B);
        costSum[2] = cost(B,A,C);
        costSum[3] = cost(B,C,A);
        costSum[4] = cost(C,A,B);
        costSum[5] = cost(C,B,A);
         int min = costSum[0];
         for (int i=0;i<costSum.length;i++){
             if(min > costSum[i]){
                 min = costSum[i];
             }
         }
         System.out.println(min);
     }
} Main public static int cost(int a,int b,int c){
        int cost = 0;
        cost = cost + Math.abs(b-a) + Math.abs(c-b);
        
        return(cost);   
    } cost {
        int cost = 0;
        cost = cost + Math.abs(b-a) + Math.abs(c-b);
        
        return(cost);   
    } int cost = 0; cost 0 cost = cost + Math.abs(b-a) + Math.abs(c-b) cost cost + Math.abs(b-a) + Math.abs(c-b) cost + Math.abs(b-a) + Math.abs(c-b) cost Math.abs(b-a) Math.abs Math b-a b a Math.abs(c-b) Math.abs Math c-b c b return(cost); (cost) int a a int b b int c c public static void main(String []args){
         int A=0; int B=0;int C=0;
         Scanner in = new Scanner(System.in);
         A = Integer.parseInt(in.next());
         B = Integer.parseInt(in.next());
         C = Integer.parseInt(in.next());
         in.close();
        
        int[] costSum = new int[6];
        costSum[0] = cost(A,B,C);
        costSum[1] = cost(A,C,B);
        costSum[2] = cost(B,A,C);
        costSum[3] = cost(B,C,A);
        costSum[4] = cost(C,A,B);
        costSum[5] = cost(C,B,A);
         int min = costSum[0];
         for (int i=0;i<costSum.length;i++){
             if(min > costSum[i]){
                 min = costSum[i];
             }
         }
         System.out.println(min);
     } main {
         int A=0; int B=0;int C=0;
         Scanner in = new Scanner(System.in);
         A = Integer.parseInt(in.next());
         B = Integer.parseInt(in.next());
         C = Integer.parseInt(in.next());
         in.close();
        
        int[] costSum = new int[6];
        costSum[0] = cost(A,B,C);
        costSum[1] = cost(A,C,B);
        costSum[2] = cost(B,A,C);
        costSum[3] = cost(B,C,A);
        costSum[4] = cost(C,A,B);
        costSum[5] = cost(C,B,A);
         int min = costSum[0];
         for (int i=0;i<costSum.length;i++){
             if(min > costSum[i]){
                 min = costSum[i];
             }
         }
         System.out.println(min);
     } int A=0; A 0 int B=0; B 0 int C=0; C 0 Scanner in = new Scanner(System.in); in new Scanner(System.in) A = Integer.parseInt(in.next()) A Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in B = Integer.parseInt(in.next()) B Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in C = Integer.parseInt(in.next()) C Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in in.close() in.close in int[] costSum = new int[6]; costSum new int[6] 6 costSum[0] = cost(A,B,C) costSum[0] costSum 0 cost(A,B,C) cost A B C costSum[1] = cost(A,C,B) costSum[1] costSum 1 cost(A,C,B) cost A C B costSum[2] = cost(B,A,C) costSum[2] costSum 2 cost(B,A,C) cost B A C costSum[3] = cost(B,C,A) costSum[3] costSum 3 cost(B,C,A) cost B C A costSum[4] = cost(C,A,B) costSum[4] costSum 4 cost(C,A,B) cost C A B costSum[5] = cost(C,B,A) costSum[5] costSum 5 cost(C,B,A) cost C B A int min = costSum[0]; min costSum[0] costSum 0 for (int i=0;i<costSum.length;i++){
             if(min > costSum[i]){
                 min = costSum[i];
             }
         } int i=0; int i=0; i 0 i<costSum.length i costSum.length costSum costSum.length i++ i++ i {
             if(min > costSum[i]){
                 min = costSum[i];
             }
         } {
             if(min > costSum[i]){
                 min = costSum[i];
             }
         } if(min > costSum[i]){
                 min = costSum[i];
             } min > costSum[i] min costSum[i] costSum i {
                 min = costSum[i];
             } min = costSum[i] min costSum[i] costSum i System.out.println(min) System.out.println System.out System System.out min String []args args public class Main{
    
    public static int cost(int a,int b,int c){
        int cost = 0;
        cost = cost + Math.abs(b-a) + Math.abs(c-b);
        
        return(cost);   
    }

     public static void main(String []args){
         int A=0; int B=0;int C=0;
         Scanner in = new Scanner(System.in);
         A = Integer.parseInt(in.next());
         B = Integer.parseInt(in.next());
         C = Integer.parseInt(in.next());
         in.close();
        
        int[] costSum = new int[6];
        costSum[0] = cost(A,B,C);
        costSum[1] = cost(A,C,B);
        costSum[2] = cost(B,A,C);
        costSum[3] = cost(B,C,A);
        costSum[4] = cost(C,A,B);
        costSum[5] = cost(C,B,A);
         int min = costSum[0];
         for (int i=0;i<costSum.length;i++){
             if(min > costSum[i]){
                 min = costSum[i];
             }
         }
         System.out.println(min);
     }
} public class Main{
    
    public static int cost(int a,int b,int c){
        int cost = 0;
        cost = cost + Math.abs(b-a) + Math.abs(c-b);
        
        return(cost);   
    }

     public static void main(String []args){
         int A=0; int B=0;int C=0;
         Scanner in = new Scanner(System.in);
         A = Integer.parseInt(in.next());
         B = Integer.parseInt(in.next());
         C = Integer.parseInt(in.next());
         in.close();
        
        int[] costSum = new int[6];
        costSum[0] = cost(A,B,C);
        costSum[1] = cost(A,C,B);
        costSum[2] = cost(B,A,C);
        costSum[3] = cost(B,C,A);
        costSum[4] = cost(C,A,B);
        costSum[5] = cost(C,B,A);
         int min = costSum[0];
         for (int i=0;i<costSum.length;i++){
             if(min > costSum[i]){
                 min = costSum[i];
             }
         }
         System.out.println(min);
     }
} Main
import java.util.Scanner;
public class Main{
    
    public static int cost(int a,int b,int c){
        int cost = 0;
        cost = cost + Math.abs(b-a) + Math.abs(c-b);
        
        return(cost);   
    }

     public static void main(String []args){
         int A=0; int B=0;int C=0;
         Scanner in = new Scanner(System.in);
         A = Integer.parseInt(in.next());
         B = Integer.parseInt(in.next());
         C = Integer.parseInt(in.next());
         in.close();
        
        int[] costSum = new int[6];
        costSum[0] = cost(A,B,C);
        costSum[1] = cost(A,C,B);
        costSum[2] = cost(B,A,C);
        costSum[3] = cost(B,C,A);
        costSum[4] = cost(C,A,B);
        costSum[5] = cost(C,B,A);
         int min = costSum[0];
         for (int i=0;i<costSum.length;i++){
             if(min > costSum[i]){
                 min = costSum[i];
             }
         }
         System.out.println(min);
     }
}