import java.util.*;

class Main{
  public static int abs(int a){
    return (a>0)?a:(-a);
  }
  
  public static int max2(int a,int b){
    return (a>b)?a:b;
  }
  
  public static int max3(int a,int b,int c){
    return (max2(a,b)>c)?max2(a,b):c;
  }
  
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int A=sc.nextInt();
    int B=sc.nextInt();
    int C=sc.nextInt();
    
    int ab=abs(A-B);
    int bc=abs(B-C);
    int ca=abs(C-A);
    
    int minus=max3(ab,bc,ca);
    
    System.out.println(ab+bc+ca-minus);
  }
} import java.util.*; util.* java class Main{
  public static int abs(int a){
    return (a>0)?a:(-a);
  }
  
  public static int max2(int a,int b){
    return (a>b)?a:b;
  }
  
  public static int max3(int a,int b,int c){
    return (max2(a,b)>c)?max2(a,b):c;
  }
  
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int A=sc.nextInt();
    int B=sc.nextInt();
    int C=sc.nextInt();
    
    int ab=abs(A-B);
    int bc=abs(B-C);
    int ca=abs(C-A);
    
    int minus=max3(ab,bc,ca);
    
    System.out.println(ab+bc+ca-minus);
  }
} Main public static int abs(int a){
    return (a>0)?a:(-a);
  } abs {
    return (a>0)?a:(-a);
  } return (a>0)?a:(-a); (a>0)?a:(-a) (a>0) a 0 a (-a) a int a a public static int max2(int a,int b){
    return (a>b)?a:b;
  } max2 {
    return (a>b)?a:b;
  } return (a>b)?a:b; (a>b)?a:b (a>b) a b a b int a a int b b public static int max3(int a,int b,int c){
    return (max2(a,b)>c)?max2(a,b):c;
  } max3 {
    return (max2(a,b)>c)?max2(a,b):c;
  } return (max2(a,b)>c)?max2(a,b):c; (max2(a,b)>c)?max2(a,b):c (max2(a,b)>c) max2(a,b) max2 a b c max2(a,b) max2 a b c int a a int b b int c c public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int A=sc.nextInt();
    int B=sc.nextInt();
    int C=sc.nextInt();
    
    int ab=abs(A-B);
    int bc=abs(B-C);
    int ca=abs(C-A);
    
    int minus=max3(ab,bc,ca);
    
    System.out.println(ab+bc+ca-minus);
  } main {
    Scanner sc=new Scanner(System.in);
    int A=sc.nextInt();
    int B=sc.nextInt();
    int C=sc.nextInt();
    
    int ab=abs(A-B);
    int bc=abs(B-C);
    int ca=abs(C-A);
    
    int minus=max3(ab,bc,ca);
    
    System.out.println(ab+bc+ca-minus);
  } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int A=sc.nextInt(); A sc.nextInt() sc.nextInt sc int B=sc.nextInt(); B sc.nextInt() sc.nextInt sc int C=sc.nextInt(); C sc.nextInt() sc.nextInt sc int ab=abs(A-B); ab abs(A-B) abs A-B A B int bc=abs(B-C); bc abs(B-C) abs B-C B C int ca=abs(C-A); ca abs(C-A) abs C-A C A int minus=max3(ab,bc,ca); minus max3(ab,bc,ca) max3 ab bc ca System.out.println(ab+bc+ca-minus) System.out.println System.out System System.out ab+bc+ca-minus ab+bc+ca ab+bc+ca ab bc ca minus String[] args args
import java.util.*;

class Main{
  public static int abs(int a){
    return (a>0)?a:(-a);
  }
  
  public static int max2(int a,int b){
    return (a>b)?a:b;
  }
  
  public static int max3(int a,int b,int c){
    return (max2(a,b)>c)?max2(a,b):c;
  }
  
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int A=sc.nextInt();
    int B=sc.nextInt();
    int C=sc.nextInt();
    
    int ab=abs(A-B);
    int bc=abs(B-C);
    int ca=abs(C-A);
    
    int minus=max3(ab,bc,ca);
    
    System.out.println(ab+bc+ca-minus);
  }
}