import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> a = new ArrayList<>();
    for (int i = 0; i < 3; i++) {
      a.add(sc.nextInt());
    }
    Collections.sort(a);
    int cost1 = a.get(1) - a.get(0);
    int cost2 = a.get(2) - a.get(1);
    System.out.println(cost1 + cost2);
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> a = new ArrayList<>();
    for (int i = 0; i < 3; i++) {
      a.add(sc.nextInt());
    }
    Collections.sort(a);
    int cost1 = a.get(1) - a.get(0);
    int cost2 = a.get(2) - a.get(1);
    System.out.println(cost1 + cost2);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> a = new ArrayList<>();
    for (int i = 0; i < 3; i++) {
      a.add(sc.nextInt());
    }
    Collections.sort(a);
    int cost1 = a.get(1) - a.get(0);
    int cost2 = a.get(2) - a.get(1);
    System.out.println(cost1 + cost2);
  } main {
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> a = new ArrayList<>();
    for (int i = 0; i < 3; i++) {
      a.add(sc.nextInt());
    }
    Collections.sort(a);
    int cost1 = a.get(1) - a.get(0);
    int cost2 = a.get(2) - a.get(1);
    System.out.println(cost1 + cost2);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) ArrayList<Integer> a = new ArrayList<>(); a new ArrayList<>() for (int i = 0; i < 3; i++) {
      a.add(sc.nextInt());
    } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
      a.add(sc.nextInt());
    } {
      a.add(sc.nextInt());
    } a.add(sc.nextInt()) a.add a sc.nextInt() sc.nextInt sc Collections.sort(a) Collections.sort Collections a int cost1 = a.get(1) - a.get(0); cost1 a.get(1) - a.get(0) a.get(1) a.get a 1 a.get(0) a.get a 0 int cost2 = a.get(2) - a.get(1); cost2 a.get(2) - a.get(1) a.get(2) a.get a 2 a.get(1) a.get a 1 System.out.println(cost1 + cost2) System.out.println System.out System System.out cost1 + cost2 cost1 cost2 String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> a = new ArrayList<>();
    for (int i = 0; i < 3; i++) {
      a.add(sc.nextInt());
    }
    Collections.sort(a);
    int cost1 = a.get(1) - a.get(0);
    int cost2 = a.get(2) - a.get(1);
    System.out.println(cost1 + cost2);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> a = new ArrayList<>();
    for (int i = 0; i < 3; i++) {
      a.add(sc.nextInt());
    }
    Collections.sort(a);
    int cost1 = a.get(1) - a.get(0);
    int cost2 = a.get(2) - a.get(1);
    System.out.println(cost1 + cost2);
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> a = new ArrayList<>();
    for (int i = 0; i < 3; i++) {
      a.add(sc.nextInt());
    }
    Collections.sort(a);
    int cost1 = a.get(1) - a.get(0);
    int cost2 = a.get(2) - a.get(1);
    System.out.println(cost1 + cost2);
  }
}