

import java.util.Scanner;

public class Main {

	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 cost = 10000;
		int p1 = Math.abs(a - b) + Math.abs(b - c);
		if (p1 < cost) {
			cost = p1;
		}
		int p2 = Math.abs(a - c) + Math.abs(b - c);
		if (p2 < cost) {
			cost = p2;
		}
		int p3 = Math.abs(b - a) + Math.abs(a - c);
		if (p3 < cost) {
			cost = p3;
		}
		int p4 = Math.abs(b - c) + Math.abs(a - c);
		if (p4 < cost) {
			cost = p4;
		}
		int p5 = Math.abs(c - b) + Math.abs(b - a);
		if (p5 < cost) {
			cost = p5;
		}
		int p6 = Math.abs(c - a) + Math.abs(a - b);
		if (p6 < cost) {
			cost = p6;
		}
		System.out.println(cost);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	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 cost = 10000;
		int p1 = Math.abs(a - b) + Math.abs(b - c);
		if (p1 < cost) {
			cost = p1;
		}
		int p2 = Math.abs(a - c) + Math.abs(b - c);
		if (p2 < cost) {
			cost = p2;
		}
		int p3 = Math.abs(b - a) + Math.abs(a - c);
		if (p3 < cost) {
			cost = p3;
		}
		int p4 = Math.abs(b - c) + Math.abs(a - c);
		if (p4 < cost) {
			cost = p4;
		}
		int p5 = Math.abs(c - b) + Math.abs(b - a);
		if (p5 < cost) {
			cost = p5;
		}
		int p6 = Math.abs(c - a) + Math.abs(a - b);
		if (p6 < cost) {
			cost = p6;
		}
		System.out.println(cost);
	}
} Main 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 cost = 10000;
		int p1 = Math.abs(a - b) + Math.abs(b - c);
		if (p1 < cost) {
			cost = p1;
		}
		int p2 = Math.abs(a - c) + Math.abs(b - c);
		if (p2 < cost) {
			cost = p2;
		}
		int p3 = Math.abs(b - a) + Math.abs(a - c);
		if (p3 < cost) {
			cost = p3;
		}
		int p4 = Math.abs(b - c) + Math.abs(a - c);
		if (p4 < cost) {
			cost = p4;
		}
		int p5 = Math.abs(c - b) + Math.abs(b - a);
		if (p5 < cost) {
			cost = p5;
		}
		int p6 = Math.abs(c - a) + Math.abs(a - b);
		if (p6 < cost) {
			cost = p6;
		}
		System.out.println(cost);
	} main {

		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();

		int cost = 10000;
		int p1 = Math.abs(a - b) + Math.abs(b - c);
		if (p1 < cost) {
			cost = p1;
		}
		int p2 = Math.abs(a - c) + Math.abs(b - c);
		if (p2 < cost) {
			cost = p2;
		}
		int p3 = Math.abs(b - a) + Math.abs(a - c);
		if (p3 < cost) {
			cost = p3;
		}
		int p4 = Math.abs(b - c) + Math.abs(a - c);
		if (p4 < cost) {
			cost = p4;
		}
		int p5 = Math.abs(c - b) + Math.abs(b - a);
		if (p5 < cost) {
			cost = p5;
		}
		int p6 = Math.abs(c - a) + Math.abs(a - b);
		if (p6 < cost) {
			cost = p6;
		}
		System.out.println(cost);
	} 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 cost = 10000; cost 10000 int p1 = Math.abs(a - b) + Math.abs(b - c); p1 Math.abs(a - b) + Math.abs(b - c) Math.abs(a - b) Math.abs Math a - b a b Math.abs(b - c) Math.abs Math b - c b c if (p1 < cost) {
			cost = p1;
		} p1 < cost p1 cost {
			cost = p1;
		} cost = p1 cost p1 int p2 = Math.abs(a - c) + Math.abs(b - c); p2 Math.abs(a - c) + Math.abs(b - c) Math.abs(a - c) Math.abs Math a - c a c Math.abs(b - c) Math.abs Math b - c b c if (p2 < cost) {
			cost = p2;
		} p2 < cost p2 cost {
			cost = p2;
		} cost = p2 cost p2 int p3 = Math.abs(b - a) + Math.abs(a - c); p3 Math.abs(b - a) + Math.abs(a - c) Math.abs(b - a) Math.abs Math b - a b a Math.abs(a - c) Math.abs Math a - c a c if (p3 < cost) {
			cost = p3;
		} p3 < cost p3 cost {
			cost = p3;
		} cost = p3 cost p3 int p4 = Math.abs(b - c) + Math.abs(a - c); p4 Math.abs(b - c) + Math.abs(a - c) Math.abs(b - c) Math.abs Math b - c b c Math.abs(a - c) Math.abs Math a - c a c if (p4 < cost) {
			cost = p4;
		} p4 < cost p4 cost {
			cost = p4;
		} cost = p4 cost p4 int p5 = Math.abs(c - b) + Math.abs(b - a); p5 Math.abs(c - b) + Math.abs(b - a) Math.abs(c - b) Math.abs Math c - b c b Math.abs(b - a) Math.abs Math b - a b a if (p5 < cost) {
			cost = p5;
		} p5 < cost p5 cost {
			cost = p5;
		} cost = p5 cost p5 int p6 = Math.abs(c - a) + Math.abs(a - b); p6 Math.abs(c - a) + Math.abs(a - b) Math.abs(c - a) Math.abs Math c - a c a Math.abs(a - b) Math.abs Math a - b a b if (p6 < cost) {
			cost = p6;
		} p6 < cost p6 cost {
			cost = p6;
		} cost = p6 cost p6 System.out.println(cost) System.out.println System.out System System.out cost String[] args args public class Main {

	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 cost = 10000;
		int p1 = Math.abs(a - b) + Math.abs(b - c);
		if (p1 < cost) {
			cost = p1;
		}
		int p2 = Math.abs(a - c) + Math.abs(b - c);
		if (p2 < cost) {
			cost = p2;
		}
		int p3 = Math.abs(b - a) + Math.abs(a - c);
		if (p3 < cost) {
			cost = p3;
		}
		int p4 = Math.abs(b - c) + Math.abs(a - c);
		if (p4 < cost) {
			cost = p4;
		}
		int p5 = Math.abs(c - b) + Math.abs(b - a);
		if (p5 < cost) {
			cost = p5;
		}
		int p6 = Math.abs(c - a) + Math.abs(a - b);
		if (p6 < cost) {
			cost = p6;
		}
		System.out.println(cost);
	}
} public class Main {

	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 cost = 10000;
		int p1 = Math.abs(a - b) + Math.abs(b - c);
		if (p1 < cost) {
			cost = p1;
		}
		int p2 = Math.abs(a - c) + Math.abs(b - c);
		if (p2 < cost) {
			cost = p2;
		}
		int p3 = Math.abs(b - a) + Math.abs(a - c);
		if (p3 < cost) {
			cost = p3;
		}
		int p4 = Math.abs(b - c) + Math.abs(a - c);
		if (p4 < cost) {
			cost = p4;
		}
		int p5 = Math.abs(c - b) + Math.abs(b - a);
		if (p5 < cost) {
			cost = p5;
		}
		int p6 = Math.abs(c - a) + Math.abs(a - b);
		if (p6 < cost) {
			cost = p6;
		}
		System.out.println(cost);
	}
} Main


import java.util.Scanner;

public class Main {

	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 cost = 10000;
		int p1 = Math.abs(a - b) + Math.abs(b - c);
		if (p1 < cost) {
			cost = p1;
		}
		int p2 = Math.abs(a - c) + Math.abs(b - c);
		if (p2 < cost) {
			cost = p2;
		}
		int p3 = Math.abs(b - a) + Math.abs(a - c);
		if (p3 < cost) {
			cost = p3;
		}
		int p4 = Math.abs(b - c) + Math.abs(a - c);
		if (p4 < cost) {
			cost = p4;
		}
		int p5 = Math.abs(c - b) + Math.abs(b - a);
		if (p5 < cost) {
			cost = p5;
		}
		int p6 = Math.abs(c - a) + Math.abs(a - b);
		if (p6 < cost) {
			cost = p6;
		}
		System.out.println(cost);
	}
}
