import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int[] A = {sc.nextInt(), sc.nextInt(), sc.nextInt()};
        int min = Integer.MAX_VALUE;
        
        // 総当たりする方法
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                if(j == i) continue;
                
                for(int k = 0; k < 3; k++){
                    if(k == i || k == j) continue;

                    int cost = Math.abs(A[i] -A[j]) + Math.abs(A[j] - A[k]);
                    if(min > cost) min = cost;
                }
            }
        }
        System.out.println(min);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int[] A = {sc.nextInt(), sc.nextInt(), sc.nextInt()};
        int min = Integer.MAX_VALUE;
        
        // 総当たりする方法
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                if(j == i) continue;
                
                for(int k = 0; k < 3; k++){
                    if(k == i || k == j) continue;

                    int cost = Math.abs(A[i] -A[j]) + Math.abs(A[j] - A[k]);
                    if(min > cost) min = cost;
                }
            }
        }
        System.out.println(min);
    }
} Main public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int[] A = {sc.nextInt(), sc.nextInt(), sc.nextInt()};
        int min = Integer.MAX_VALUE;
        
        // 総当たりする方法
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                if(j == i) continue;
                
                for(int k = 0; k < 3; k++){
                    if(k == i || k == j) continue;

                    int cost = Math.abs(A[i] -A[j]) + Math.abs(A[j] - A[k]);
                    if(min > cost) min = cost;
                }
            }
        }
        System.out.println(min);
    } main {
        
        Scanner sc = new Scanner(System.in);
        int[] A = {sc.nextInt(), sc.nextInt(), sc.nextInt()};
        int min = Integer.MAX_VALUE;
        
        // 総当たりする方法
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                if(j == i) continue;
                
                for(int k = 0; k < 3; k++){
                    if(k == i || k == j) continue;

                    int cost = Math.abs(A[i] -A[j]) + Math.abs(A[j] - A[k]);
                    if(min > cost) min = cost;
                }
            }
        }
        System.out.println(min);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] A = {sc.nextInt(), sc.nextInt(), sc.nextInt()}; A {sc.nextInt(), sc.nextInt(), sc.nextInt()} sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                if(j == i) continue;
                
                for(int k = 0; k < 3; k++){
                    if(k == i || k == j) continue;

                    int cost = Math.abs(A[i] -A[j]) + Math.abs(A[j] - A[k]);
                    if(min > cost) min = cost;
                }
            }
        } 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;
                
                for(int k = 0; k < 3; k++){
                    if(k == i || k == j) continue;

                    int cost = Math.abs(A[i] -A[j]) + Math.abs(A[j] - A[k]);
                    if(min > cost) min = cost;
                }
            }
        } {
            for(int j = 0; j < 3; j++){
                if(j == i) continue;
                
                for(int k = 0; k < 3; k++){
                    if(k == i || k == j) continue;

                    int cost = Math.abs(A[i] -A[j]) + Math.abs(A[j] - A[k]);
                    if(min > cost) min = cost;
                }
            }
        } for(int j = 0; j < 3; j++){
                if(j == i) continue;
                
                for(int k = 0; k < 3; k++){
                    if(k == i || k == j) continue;

                    int cost = Math.abs(A[i] -A[j]) + Math.abs(A[j] - A[k]);
                    if(min > cost) min = cost;
                }
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                if(j == i) continue;
                
                for(int k = 0; k < 3; k++){
                    if(k == i || k == j) continue;

                    int cost = Math.abs(A[i] -A[j]) + Math.abs(A[j] - A[k]);
                    if(min > cost) min = cost;
                }
            } {
                if(j == i) continue;
                
                for(int k = 0; k < 3; k++){
                    if(k == i || k == j) continue;

                    int cost = Math.abs(A[i] -A[j]) + Math.abs(A[j] - A[k]);
                    if(min > cost) min = cost;
                }
            } if(j == i) continue; j == i j i continue; for(int k = 0; k < 3; k++){
                    if(k == i || k == j) continue;

                    int cost = Math.abs(A[i] -A[j]) + Math.abs(A[j] - A[k]);
                    if(min > cost) min = cost;
                } int k = 0; int k = 0; k 0 k < 3 k 3 k++ k++ k {
                    if(k == i || k == j) continue;

                    int cost = Math.abs(A[i] -A[j]) + Math.abs(A[j] - A[k]);
                    if(min > cost) min = cost;
                } {
                    if(k == i || k == j) continue;

                    int cost = Math.abs(A[i] -A[j]) + Math.abs(A[j] - A[k]);
                    if(min > cost) min = cost;
                } if(k == i || k == j) continue; k == i || k == j k == i k i k == j k j continue; int cost = Math.abs(A[i] -A[j]) + Math.abs(A[j] - A[k]); cost Math.abs(A[i] -A[j]) + Math.abs(A[j] - A[k]) Math.abs(A[i] -A[j]) Math.abs Math A[i] -A[j] A[i] A i A[j] A j Math.abs(A[j] - A[k]) Math.abs Math A[j] - A[k] A[j] A j A[k] A k if(min > cost) min = cost; min > cost min cost min = cost min cost System.out.println(min) System.out.println System.out System System.out min String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int[] A = {sc.nextInt(), sc.nextInt(), sc.nextInt()};
        int min = Integer.MAX_VALUE;
        
        // 総当たりする方法
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                if(j == i) continue;
                
                for(int k = 0; k < 3; k++){
                    if(k == i || k == j) continue;

                    int cost = Math.abs(A[i] -A[j]) + Math.abs(A[j] - A[k]);
                    if(min > cost) min = cost;
                }
            }
        }
        System.out.println(min);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int[] A = {sc.nextInt(), sc.nextInt(), sc.nextInt()};
        int min = Integer.MAX_VALUE;
        
        // 総当たりする方法
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                if(j == i) continue;
                
                for(int k = 0; k < 3; k++){
                    if(k == i || k == j) continue;

                    int cost = Math.abs(A[i] -A[j]) + Math.abs(A[j] - A[k]);
                    if(min > cost) min = cost;
                }
            }
        }
        System.out.println(min);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int[] A = {sc.nextInt(), sc.nextInt(), sc.nextInt()};
        int min = Integer.MAX_VALUE;
        
        // 総当たりする方法
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                if(j == i) continue;
                
                for(int k = 0; k < 3; k++){
                    if(k == i || k == j) continue;

                    int cost = Math.abs(A[i] -A[j]) + Math.abs(A[j] - A[k]);
                    if(min > cost) min = cost;
                }
            }
        }
        System.out.println(min);
    }
}
