import java.util.*;
import java.lang.*;

public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int[] a = new int[3];
        for(int i=0; i<3; i++){
            a[i] = sc.nextInt();
        }
        int cost = 10000;
        int pcost = 0;
        
        for(int i=0; i<3; i++){
            for(int j=0; j<3; j++){
                if(i != j){
                    for(int k=0; k<3; k++){
                        if(k != i && k != j){
                            pcost = Math.abs(a[j]-a[i]) + Math.abs(a[k]-a[j]);
                            if(pcost < cost){
                                cost = pcost;
                            }
                        }
                    }
                }
            }
        }
        System.out.println(cost);
    }
} import java.util.*; util.* java import java.lang.*; lang.* java public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int[] a = new int[3];
        for(int i=0; i<3; i++){
            a[i] = sc.nextInt();
        }
        int cost = 10000;
        int pcost = 0;
        
        for(int i=0; i<3; i++){
            for(int j=0; j<3; j++){
                if(i != j){
                    for(int k=0; k<3; k++){
                        if(k != i && k != j){
                            pcost = Math.abs(a[j]-a[i]) + Math.abs(a[k]-a[j]);
                            if(pcost < cost){
                                cost = pcost;
                            }
                        }
                    }
                }
            }
        }
        System.out.println(cost);
    }
} Main public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int[] a = new int[3];
        for(int i=0; i<3; i++){
            a[i] = sc.nextInt();
        }
        int cost = 10000;
        int pcost = 0;
        
        for(int i=0; i<3; i++){
            for(int j=0; j<3; j++){
                if(i != j){
                    for(int k=0; k<3; k++){
                        if(k != i && k != j){
                            pcost = Math.abs(a[j]-a[i]) + Math.abs(a[k]-a[j]);
                            if(pcost < cost){
                                cost = pcost;
                            }
                        }
                    }
                }
            }
        }
        System.out.println(cost);
    } main {
        Scanner sc = new Scanner(System.in);
        int[] a = new int[3];
        for(int i=0; i<3; i++){
            a[i] = sc.nextInt();
        }
        int cost = 10000;
        int pcost = 0;
        
        for(int i=0; i<3; i++){
            for(int j=0; j<3; j++){
                if(i != j){
                    for(int k=0; k<3; k++){
                        if(k != i && k != j){
                            pcost = Math.abs(a[j]-a[i]) + Math.abs(a[k]-a[j]);
                            if(pcost < cost){
                                cost = pcost;
                            }
                        }
                    }
                }
            }
        }
        System.out.println(cost);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] a = new int[3]; a new int[3] 3 for(int i=0; i<3; i++){
            a[i] = sc.nextInt();
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
            a[i] = sc.nextInt();
        } {
            a[i] = sc.nextInt();
        } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc int cost = 10000; cost 10000 int pcost = 0; pcost 0 for(int i=0; i<3; i++){
            for(int j=0; j<3; j++){
                if(i != j){
                    for(int k=0; k<3; k++){
                        if(k != i && k != j){
                            pcost = Math.abs(a[j]-a[i]) + Math.abs(a[k]-a[j]);
                            if(pcost < cost){
                                cost = pcost;
                            }
                        }
                    }
                }
            }
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
            for(int j=0; j<3; j++){
                if(i != j){
                    for(int k=0; k<3; k++){
                        if(k != i && k != j){
                            pcost = Math.abs(a[j]-a[i]) + Math.abs(a[k]-a[j]);
                            if(pcost < cost){
                                cost = pcost;
                            }
                        }
                    }
                }
            }
        } {
            for(int j=0; j<3; j++){
                if(i != j){
                    for(int k=0; k<3; k++){
                        if(k != i && k != j){
                            pcost = Math.abs(a[j]-a[i]) + Math.abs(a[k]-a[j]);
                            if(pcost < cost){
                                cost = pcost;
                            }
                        }
                    }
                }
            }
        } for(int j=0; j<3; j++){
                if(i != j){
                    for(int k=0; k<3; k++){
                        if(k != i && k != j){
                            pcost = Math.abs(a[j]-a[i]) + Math.abs(a[k]-a[j]);
                            if(pcost < cost){
                                cost = pcost;
                            }
                        }
                    }
                }
            } int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
                if(i != j){
                    for(int k=0; k<3; k++){
                        if(k != i && k != j){
                            pcost = Math.abs(a[j]-a[i]) + Math.abs(a[k]-a[j]);
                            if(pcost < cost){
                                cost = pcost;
                            }
                        }
                    }
                }
            } {
                if(i != j){
                    for(int k=0; k<3; k++){
                        if(k != i && k != j){
                            pcost = Math.abs(a[j]-a[i]) + Math.abs(a[k]-a[j]);
                            if(pcost < cost){
                                cost = pcost;
                            }
                        }
                    }
                }
            } if(i != j){
                    for(int k=0; k<3; k++){
                        if(k != i && k != j){
                            pcost = Math.abs(a[j]-a[i]) + Math.abs(a[k]-a[j]);
                            if(pcost < cost){
                                cost = pcost;
                            }
                        }
                    }
                } i != j i j {
                    for(int k=0; k<3; k++){
                        if(k != i && k != j){
                            pcost = Math.abs(a[j]-a[i]) + Math.abs(a[k]-a[j]);
                            if(pcost < cost){
                                cost = pcost;
                            }
                        }
                    }
                } for(int k=0; k<3; k++){
                        if(k != i && k != j){
                            pcost = Math.abs(a[j]-a[i]) + Math.abs(a[k]-a[j]);
                            if(pcost < cost){
                                cost = pcost;
                            }
                        }
                    } int k=0; int k=0; k 0 k<3 k 3 k++ k++ k {
                        if(k != i && k != j){
                            pcost = Math.abs(a[j]-a[i]) + Math.abs(a[k]-a[j]);
                            if(pcost < cost){
                                cost = pcost;
                            }
                        }
                    } {
                        if(k != i && k != j){
                            pcost = Math.abs(a[j]-a[i]) + Math.abs(a[k]-a[j]);
                            if(pcost < cost){
                                cost = pcost;
                            }
                        }
                    } if(k != i && k != j){
                            pcost = Math.abs(a[j]-a[i]) + Math.abs(a[k]-a[j]);
                            if(pcost < cost){
                                cost = pcost;
                            }
                        } k != i && k != j k != i k i k != j k j {
                            pcost = Math.abs(a[j]-a[i]) + Math.abs(a[k]-a[j]);
                            if(pcost < cost){
                                cost = pcost;
                            }
                        } pcost = Math.abs(a[j]-a[i]) + Math.abs(a[k]-a[j]) pcost Math.abs(a[j]-a[i]) + Math.abs(a[k]-a[j]) Math.abs(a[j]-a[i]) Math.abs Math a[j]-a[i] a[j] a j a[i] a i Math.abs(a[k]-a[j]) Math.abs Math a[k]-a[j] a[k] a k a[j] a j if(pcost < cost){
                                cost = pcost;
                            } pcost < cost pcost cost {
                                cost = pcost;
                            } cost = pcost cost pcost System.out.println(cost) System.out.println System.out System System.out cost String args[] args public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int[] a = new int[3];
        for(int i=0; i<3; i++){
            a[i] = sc.nextInt();
        }
        int cost = 10000;
        int pcost = 0;
        
        for(int i=0; i<3; i++){
            for(int j=0; j<3; j++){
                if(i != j){
                    for(int k=0; k<3; k++){
                        if(k != i && k != j){
                            pcost = Math.abs(a[j]-a[i]) + Math.abs(a[k]-a[j]);
                            if(pcost < cost){
                                cost = pcost;
                            }
                        }
                    }
                }
            }
        }
        System.out.println(cost);
    }
} public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int[] a = new int[3];
        for(int i=0; i<3; i++){
            a[i] = sc.nextInt();
        }
        int cost = 10000;
        int pcost = 0;
        
        for(int i=0; i<3; i++){
            for(int j=0; j<3; j++){
                if(i != j){
                    for(int k=0; k<3; k++){
                        if(k != i && k != j){
                            pcost = Math.abs(a[j]-a[i]) + Math.abs(a[k]-a[j]);
                            if(pcost < cost){
                                cost = pcost;
                            }
                        }
                    }
                }
            }
        }
        System.out.println(cost);
    }
} Main
import java.util.*;
import java.lang.*;

public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int[] a = new int[3];
        for(int i=0; i<3; i++){
            a[i] = sc.nextInt();
        }
        int cost = 10000;
        int pcost = 0;
        
        for(int i=0; i<3; i++){
            for(int j=0; j<3; j++){
                if(i != j){
                    for(int k=0; k<3; k++){
                        if(k != i && k != j){
                            pcost = Math.abs(a[j]-a[i]) + Math.abs(a[k]-a[j]);
                            if(pcost < cost){
                                cost = pcost;
                            }
                        }
                    }
                }
            }
        }
        System.out.println(cost);
    }
}