import java.util.*;
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 b1 = (int)(Math.abs(a1-a2));
	int b2 = (int)(Math.abs(a3-a2));
	int b3 = (int)(Math.abs(a1-a3));
	int max = Math.max(b1,Math.max(b2,b3));
	System.out.println(b1+b2+b3-max);

    }
} import java.util.*; util.* java 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 b1 = (int)(Math.abs(a1-a2));
	int b2 = (int)(Math.abs(a3-a2));
	int b3 = (int)(Math.abs(a1-a3));
	int max = Math.max(b1,Math.max(b2,b3));
	System.out.println(b1+b2+b3-max);

    }
} 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 b1 = (int)(Math.abs(a1-a2));
	int b2 = (int)(Math.abs(a3-a2));
	int b3 = (int)(Math.abs(a1-a3));
	int max = Math.max(b1,Math.max(b2,b3));
	System.out.println(b1+b2+b3-max);

    } main {
	Scanner sc = new Scanner(System.in);
	int a1 = sc.nextInt();
	int a2 = sc.nextInt();
	int a3 = sc.nextInt();
	int b1 = (int)(Math.abs(a1-a2));
	int b2 = (int)(Math.abs(a3-a2));
	int b3 = (int)(Math.abs(a1-a3));
	int max = Math.max(b1,Math.max(b2,b3));
	System.out.println(b1+b2+b3-max);

    } 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 b1 = (int)(Math.abs(a1-a2)); b1 (int)(Math.abs(a1-a2)) Math.abs Math a1-a2 a1 a2 int b2 = (int)(Math.abs(a3-a2)); b2 (int)(Math.abs(a3-a2)) Math.abs Math a3-a2 a3 a2 int b3 = (int)(Math.abs(a1-a3)); b3 (int)(Math.abs(a1-a3)) Math.abs Math a1-a3 a1 a3 int max = Math.max(b1,Math.max(b2,b3)); max Math.max(b1,Math.max(b2,b3)) Math.max Math b1 Math.max(b2,b3) Math.max Math b2 b3 System.out.println(b1+b2+b3-max) System.out.println System.out System System.out b1+b2+b3-max b1+b2+b3 b1+b2+b3 b1 b2 b3 max String[] args args
import java.util.*;
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 b1 = (int)(Math.abs(a1-a2));
	int b2 = (int)(Math.abs(a3-a2));
	int b3 = (int)(Math.abs(a1-a3));
	int max = Math.max(b1,Math.max(b2,b3));
	System.out.println(b1+b2+b3-max);

    }
}