import java.util.Scanner;

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] = Integer.parseInt(sc.next());
        }
        sort(a, 0, 2);
        int cost = (a[1]- a[0]);
        cost += (a[2] - a[1]);
        System.out.println(cost);
    }
    
    private static void sort(int[] d, int left, int right){
        if(left>=right){return;}
        int p = d[(left+right)/2];
        int l=left, r=right;
        int tmp;
        while(l<=r){
            while(d[l]<p){l++;}
            while(d[r]>p){r--;}
            if(l<=r){
                tmp=d[l];
                d[l] = d[r];
                d[r] = tmp;
                l++; r--;
            }
        }
        sort(d, left, r);
        sort(d, l, right);
    }
} import java.util.Scanner; Scanner java.util 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] = Integer.parseInt(sc.next());
        }
        sort(a, 0, 2);
        int cost = (a[1]- a[0]);
        cost += (a[2] - a[1]);
        System.out.println(cost);
    }
    
    private static void sort(int[] d, int left, int right){
        if(left>=right){return;}
        int p = d[(left+right)/2];
        int l=left, r=right;
        int tmp;
        while(l<=r){
            while(d[l]<p){l++;}
            while(d[r]>p){r--;}
            if(l<=r){
                tmp=d[l];
                d[l] = d[r];
                d[r] = tmp;
                l++; r--;
            }
        }
        sort(d, left, r);
        sort(d, l, right);
    }
} 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] = Integer.parseInt(sc.next());
        }
        sort(a, 0, 2);
        int cost = (a[1]- a[0]);
        cost += (a[2] - a[1]);
        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] = Integer.parseInt(sc.next());
        }
        sort(a, 0, 2);
        int cost = (a[1]- a[0]);
        cost += (a[2] - a[1]);
        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] = Integer.parseInt(sc.next());
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
            a[i] = Integer.parseInt(sc.next());
        } {
            a[i] = Integer.parseInt(sc.next());
        } a[i] = Integer.parseInt(sc.next()) a[i] a i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc sort(a, 0, 2) sort a 0 2 int cost = (a[1]- a[0]); cost (a[1]- a[0]) a[1] a 1 a[0] a 0 cost += (a[2] - a[1]) cost (a[2] - a[1]) a[2] a 2 a[1] a 1 System.out.println(cost) System.out.println System.out System System.out cost String[] args args private static void sort(int[] d, int left, int right){
        if(left>=right){return;}
        int p = d[(left+right)/2];
        int l=left, r=right;
        int tmp;
        while(l<=r){
            while(d[l]<p){l++;}
            while(d[r]>p){r--;}
            if(l<=r){
                tmp=d[l];
                d[l] = d[r];
                d[r] = tmp;
                l++; r--;
            }
        }
        sort(d, left, r);
        sort(d, l, right);
    } sort {
        if(left>=right){return;}
        int p = d[(left+right)/2];
        int l=left, r=right;
        int tmp;
        while(l<=r){
            while(d[l]<p){l++;}
            while(d[r]>p){r--;}
            if(l<=r){
                tmp=d[l];
                d[l] = d[r];
                d[r] = tmp;
                l++; r--;
            }
        }
        sort(d, left, r);
        sort(d, l, right);
    } if(left>=right){return;} left>=right left right {return;} return; int p = d[(left+right)/2]; p d[(left+right)/2] d (left+right)/2 (left+right) left right 2 int l=left l left r=right; r right int tmp; tmp while(l<=r){
            while(d[l]<p){l++;}
            while(d[r]>p){r--;}
            if(l<=r){
                tmp=d[l];
                d[l] = d[r];
                d[r] = tmp;
                l++; r--;
            }
        } l<=r l r {
            while(d[l]<p){l++;}
            while(d[r]>p){r--;}
            if(l<=r){
                tmp=d[l];
                d[l] = d[r];
                d[r] = tmp;
                l++; r--;
            }
        } while(d[l]<p){l++;} d[l]<p d[l] d l p {l++;} l++ l while(d[r]>p){r--;} d[r]>p d[r] d r p {r--;} r-- r if(l<=r){
                tmp=d[l];
                d[l] = d[r];
                d[r] = tmp;
                l++; r--;
            } l<=r l r {
                tmp=d[l];
                d[l] = d[r];
                d[r] = tmp;
                l++; r--;
            } tmp=d[l] tmp d[l] d l d[l] = d[r] d[l] d l d[r] d r d[r] = tmp d[r] d r tmp l++ l r-- r sort(d, left, r) sort d left r sort(d, l, right) sort d l right int[] d d int left left int right right 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] = Integer.parseInt(sc.next());
        }
        sort(a, 0, 2);
        int cost = (a[1]- a[0]);
        cost += (a[2] - a[1]);
        System.out.println(cost);
    }
    
    private static void sort(int[] d, int left, int right){
        if(left>=right){return;}
        int p = d[(left+right)/2];
        int l=left, r=right;
        int tmp;
        while(l<=r){
            while(d[l]<p){l++;}
            while(d[r]>p){r--;}
            if(l<=r){
                tmp=d[l];
                d[l] = d[r];
                d[r] = tmp;
                l++; r--;
            }
        }
        sort(d, left, r);
        sort(d, l, right);
    }
} 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] = Integer.parseInt(sc.next());
        }
        sort(a, 0, 2);
        int cost = (a[1]- a[0]);
        cost += (a[2] - a[1]);
        System.out.println(cost);
    }
    
    private static void sort(int[] d, int left, int right){
        if(left>=right){return;}
        int p = d[(left+right)/2];
        int l=left, r=right;
        int tmp;
        while(l<=r){
            while(d[l]<p){l++;}
            while(d[r]>p){r--;}
            if(l<=r){
                tmp=d[l];
                d[l] = d[r];
                d[r] = tmp;
                l++; r--;
            }
        }
        sort(d, left, r);
        sort(d, l, right);
    }
} Main
import java.util.Scanner;

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] = Integer.parseInt(sc.next());
        }
        sort(a, 0, 2);
        int cost = (a[1]- a[0]);
        cost += (a[2] - a[1]);
        System.out.println(cost);
    }
    
    private static void sort(int[] d, int left, int right){
        if(left>=right){return;}
        int p = d[(left+right)/2];
        int l=left, r=right;
        int tmp;
        while(l<=r){
            while(d[l]<p){l++;}
            while(d[r]>p){r--;}
            if(l<=r){
                tmp=d[l];
                d[l] = d[r];
                d[r] = tmp;
                l++; r--;
            }
        }
        sort(d, left, r);
        sort(d, l, right);
    }
}
