import java.util.*;
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a1 = sc.nextInt(); int a2 = sc.nextInt(); int a3 = sc.nextInt();
    int c12 = Math.abs(a1-a2);
    int c23 = Math.abs(a2-a3);
    int c31 = Math.abs(a3-a1);
    System.out.println(c12+c23+c31-Math.max(Math.max(c12, c23), c31));
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a1 = sc.nextInt(); int a2 = sc.nextInt(); int a3 = sc.nextInt();
    int c12 = Math.abs(a1-a2);
    int c23 = Math.abs(a2-a3);
    int c31 = Math.abs(a3-a1);
    System.out.println(c12+c23+c31-Math.max(Math.max(c12, c23), c31));
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a1 = sc.nextInt(); int a2 = sc.nextInt(); int a3 = sc.nextInt();
    int c12 = Math.abs(a1-a2);
    int c23 = Math.abs(a2-a3);
    int c31 = Math.abs(a3-a1);
    System.out.println(c12+c23+c31-Math.max(Math.max(c12, c23), c31));
  } main {
    Scanner sc = new Scanner(System.in);
    int a1 = sc.nextInt(); int a2 = sc.nextInt(); int a3 = sc.nextInt();
    int c12 = Math.abs(a1-a2);
    int c23 = Math.abs(a2-a3);
    int c31 = Math.abs(a3-a1);
    System.out.println(c12+c23+c31-Math.max(Math.max(c12, c23), c31));
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a1 = sc.nextInt(); a1 sc.nextInt() sc.nextInt sc int a2 = sc.nextInt(); a2 sc.nextInt() sc.nextInt sc int a3 = sc.nextInt(); a3 sc.nextInt() sc.nextInt sc int c12 = Math.abs(a1-a2); c12 Math.abs(a1-a2) Math.abs Math a1-a2 a1 a2 int c23 = Math.abs(a2-a3); c23 Math.abs(a2-a3) Math.abs Math a2-a3 a2 a3 int c31 = Math.abs(a3-a1); c31 Math.abs(a3-a1) Math.abs Math a3-a1 a3 a1 System.out.println(c12+c23+c31-Math.max(Math.max(c12, c23), c31)) System.out.println System.out System System.out c12+c23+c31-Math.max(Math.max(c12, c23), c31) c12+c23+c31 c12+c23+c31 c12 c23 c31 Math.max(Math.max(c12, c23), c31) Math.max Math Math.max(c12, c23) Math.max Math c12 c23 c31 String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a1 = sc.nextInt(); int a2 = sc.nextInt(); int a3 = sc.nextInt();
    int c12 = Math.abs(a1-a2);
    int c23 = Math.abs(a2-a3);
    int c31 = Math.abs(a3-a1);
    System.out.println(c12+c23+c31-Math.max(Math.max(c12, c23), c31));
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a1 = sc.nextInt(); int a2 = sc.nextInt(); int a3 = sc.nextInt();
    int c12 = Math.abs(a1-a2);
    int c23 = Math.abs(a2-a3);
    int c31 = Math.abs(a3-a1);
    System.out.println(c12+c23+c31-Math.max(Math.max(c12, c23), c31));
  }
} Main
import java.util.*;
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a1 = sc.nextInt(); int a2 = sc.nextInt(); int a3 = sc.nextInt();
    int c12 = Math.abs(a1-a2);
    int c23 = Math.abs(a2-a3);
    int c31 = Math.abs(a3-a1);
    System.out.println(c12+c23+c31-Math.max(Math.max(c12, c23), c31));
  }
}