import java.util.*;

public class Main {
	public static void main(String[] args) {
		int N = 3;
		Scanner sc = new Scanner(System.in);
		int[] As = new int[N];
		As[0] = sc.nextInt();
		As[1] = sc.nextInt();
		As[2] = sc.nextInt();

		int minCost = Integer.MAX_VALUE;

		for (int i = 0; i < N; i++) {
			for (int j = 0; j < N; j++) {
				for (int k = 0; k < N; k++) {
					if ( i != j && j != k && k != i ) {
						int cost = 0;
						cost += 0;
						cost += Math.abs(As[i] - As[j]);
						cost += Math.abs(As[j] - As[k]);

//					System.out.println(i +","+ j + "," + k + "," + cost);
//
						if (cost < minCost) {
							minCost = cost;
						}
//
					}
				}
			}
		}

		System.out.println(minCost);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		int N = 3;
		Scanner sc = new Scanner(System.in);
		int[] As = new int[N];
		As[0] = sc.nextInt();
		As[1] = sc.nextInt();
		As[2] = sc.nextInt();

		int minCost = Integer.MAX_VALUE;

		for (int i = 0; i < N; i++) {
			for (int j = 0; j < N; j++) {
				for (int k = 0; k < N; k++) {
					if ( i != j && j != k && k != i ) {
						int cost = 0;
						cost += 0;
						cost += Math.abs(As[i] - As[j]);
						cost += Math.abs(As[j] - As[k]);

//					System.out.println(i +","+ j + "," + k + "," + cost);
//
						if (cost < minCost) {
							minCost = cost;
						}
//
					}
				}
			}
		}

		System.out.println(minCost);
	}
} Main public static void main(String[] args) {
		int N = 3;
		Scanner sc = new Scanner(System.in);
		int[] As = new int[N];
		As[0] = sc.nextInt();
		As[1] = sc.nextInt();
		As[2] = sc.nextInt();

		int minCost = Integer.MAX_VALUE;

		for (int i = 0; i < N; i++) {
			for (int j = 0; j < N; j++) {
				for (int k = 0; k < N; k++) {
					if ( i != j && j != k && k != i ) {
						int cost = 0;
						cost += 0;
						cost += Math.abs(As[i] - As[j]);
						cost += Math.abs(As[j] - As[k]);

//					System.out.println(i +","+ j + "," + k + "," + cost);
//
						if (cost < minCost) {
							minCost = cost;
						}
//
					}
				}
			}
		}

		System.out.println(minCost);
	} main {
		int N = 3;
		Scanner sc = new Scanner(System.in);
		int[] As = new int[N];
		As[0] = sc.nextInt();
		As[1] = sc.nextInt();
		As[2] = sc.nextInt();

		int minCost = Integer.MAX_VALUE;

		for (int i = 0; i < N; i++) {
			for (int j = 0; j < N; j++) {
				for (int k = 0; k < N; k++) {
					if ( i != j && j != k && k != i ) {
						int cost = 0;
						cost += 0;
						cost += Math.abs(As[i] - As[j]);
						cost += Math.abs(As[j] - As[k]);

//					System.out.println(i +","+ j + "," + k + "," + cost);
//
						if (cost < minCost) {
							minCost = cost;
						}
//
					}
				}
			}
		}

		System.out.println(minCost);
	} int N = 3; N 3 Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] As = new int[N]; As new int[N] N As[0] = sc.nextInt() As[0] As 0 sc.nextInt() sc.nextInt sc As[1] = sc.nextInt() As[1] As 1 sc.nextInt() sc.nextInt sc As[2] = sc.nextInt() As[2] As 2 sc.nextInt() sc.nextInt sc int minCost = Integer.MAX_VALUE; minCost Integer.MAX_VALUE Integer Integer.MAX_VALUE for (int i = 0; i < N; i++) {
			for (int j = 0; j < N; j++) {
				for (int k = 0; k < N; k++) {
					if ( i != j && j != k && k != i ) {
						int cost = 0;
						cost += 0;
						cost += Math.abs(As[i] - As[j]);
						cost += Math.abs(As[j] - As[k]);

//					System.out.println(i +","+ j + "," + k + "," + cost);
//
						if (cost < minCost) {
							minCost = cost;
						}
//
					}
				}
			}
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			for (int j = 0; j < N; j++) {
				for (int k = 0; k < N; k++) {
					if ( i != j && j != k && k != i ) {
						int cost = 0;
						cost += 0;
						cost += Math.abs(As[i] - As[j]);
						cost += Math.abs(As[j] - As[k]);

//					System.out.println(i +","+ j + "," + k + "," + cost);
//
						if (cost < minCost) {
							minCost = cost;
						}
//
					}
				}
			}
		} {
			for (int j = 0; j < N; j++) {
				for (int k = 0; k < N; k++) {
					if ( i != j && j != k && k != i ) {
						int cost = 0;
						cost += 0;
						cost += Math.abs(As[i] - As[j]);
						cost += Math.abs(As[j] - As[k]);

//					System.out.println(i +","+ j + "," + k + "," + cost);
//
						if (cost < minCost) {
							minCost = cost;
						}
//
					}
				}
			}
		} for (int j = 0; j < N; j++) {
				for (int k = 0; k < N; k++) {
					if ( i != j && j != k && k != i ) {
						int cost = 0;
						cost += 0;
						cost += Math.abs(As[i] - As[j]);
						cost += Math.abs(As[j] - As[k]);

//					System.out.println(i +","+ j + "," + k + "," + cost);
//
						if (cost < minCost) {
							minCost = cost;
						}
//
					}
				}
			} int j = 0; int j = 0; j 0 j < N j N j++ j++ j {
				for (int k = 0; k < N; k++) {
					if ( i != j && j != k && k != i ) {
						int cost = 0;
						cost += 0;
						cost += Math.abs(As[i] - As[j]);
						cost += Math.abs(As[j] - As[k]);

//					System.out.println(i +","+ j + "," + k + "," + cost);
//
						if (cost < minCost) {
							minCost = cost;
						}
//
					}
				}
			} {
				for (int k = 0; k < N; k++) {
					if ( i != j && j != k && k != i ) {
						int cost = 0;
						cost += 0;
						cost += Math.abs(As[i] - As[j]);
						cost += Math.abs(As[j] - As[k]);

//					System.out.println(i +","+ j + "," + k + "," + cost);
//
						if (cost < minCost) {
							minCost = cost;
						}
//
					}
				}
			} for (int k = 0; k < N; k++) {
					if ( i != j && j != k && k != i ) {
						int cost = 0;
						cost += 0;
						cost += Math.abs(As[i] - As[j]);
						cost += Math.abs(As[j] - As[k]);

//					System.out.println(i +","+ j + "," + k + "," + cost);
//
						if (cost < minCost) {
							minCost = cost;
						}
//
					}
				} int k = 0; int k = 0; k 0 k < N k N k++ k++ k {
					if ( i != j && j != k && k != i ) {
						int cost = 0;
						cost += 0;
						cost += Math.abs(As[i] - As[j]);
						cost += Math.abs(As[j] - As[k]);

//					System.out.println(i +","+ j + "," + k + "," + cost);
//
						if (cost < minCost) {
							minCost = cost;
						}
//
					}
				} {
					if ( i != j && j != k && k != i ) {
						int cost = 0;
						cost += 0;
						cost += Math.abs(As[i] - As[j]);
						cost += Math.abs(As[j] - As[k]);

//					System.out.println(i +","+ j + "," + k + "," + cost);
//
						if (cost < minCost) {
							minCost = cost;
						}
//
					}
				} if ( i != j && j != k && k != i ) {
						int cost = 0;
						cost += 0;
						cost += Math.abs(As[i] - As[j]);
						cost += Math.abs(As[j] - As[k]);

//					System.out.println(i +","+ j + "," + k + "," + cost);
//
						if (cost < minCost) {
							minCost = cost;
						}
//
					} i != j && j != k && k != i i != j && j != k && k != i i != j i j j != k j k k != i k i {
						int cost = 0;
						cost += 0;
						cost += Math.abs(As[i] - As[j]);
						cost += Math.abs(As[j] - As[k]);

//					System.out.println(i +","+ j + "," + k + "," + cost);
//
						if (cost < minCost) {
							minCost = cost;
						}
//
					} int cost = 0; cost 0 cost += 0 cost 0 cost += Math.abs(As[i] - As[j]) cost Math.abs(As[i] - As[j]) Math.abs Math As[i] - As[j] As[i] As i As[j] As j cost += Math.abs(As[j] - As[k]) cost Math.abs(As[j] - As[k]) Math.abs Math As[j] - As[k] As[j] As j As[k] As k if (cost < minCost) {
							minCost = cost;
						} cost < minCost cost minCost {
							minCost = cost;
						} minCost = cost minCost cost System.out.println(minCost) System.out.println System.out System System.out minCost String[] args args public class Main {
	public static void main(String[] args) {
		int N = 3;
		Scanner sc = new Scanner(System.in);
		int[] As = new int[N];
		As[0] = sc.nextInt();
		As[1] = sc.nextInt();
		As[2] = sc.nextInt();

		int minCost = Integer.MAX_VALUE;

		for (int i = 0; i < N; i++) {
			for (int j = 0; j < N; j++) {
				for (int k = 0; k < N; k++) {
					if ( i != j && j != k && k != i ) {
						int cost = 0;
						cost += 0;
						cost += Math.abs(As[i] - As[j]);
						cost += Math.abs(As[j] - As[k]);

//					System.out.println(i +","+ j + "," + k + "," + cost);
//
						if (cost < minCost) {
							minCost = cost;
						}
//
					}
				}
			}
		}

		System.out.println(minCost);
	}
} public class Main {
	public static void main(String[] args) {
		int N = 3;
		Scanner sc = new Scanner(System.in);
		int[] As = new int[N];
		As[0] = sc.nextInt();
		As[1] = sc.nextInt();
		As[2] = sc.nextInt();

		int minCost = Integer.MAX_VALUE;

		for (int i = 0; i < N; i++) {
			for (int j = 0; j < N; j++) {
				for (int k = 0; k < N; k++) {
					if ( i != j && j != k && k != i ) {
						int cost = 0;
						cost += 0;
						cost += Math.abs(As[i] - As[j]);
						cost += Math.abs(As[j] - As[k]);

//					System.out.println(i +","+ j + "," + k + "," + cost);
//
						if (cost < minCost) {
							minCost = cost;
						}
//
					}
				}
			}
		}

		System.out.println(minCost);
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		int N = 3;
		Scanner sc = new Scanner(System.in);
		int[] As = new int[N];
		As[0] = sc.nextInt();
		As[1] = sc.nextInt();
		As[2] = sc.nextInt();

		int minCost = Integer.MAX_VALUE;

		for (int i = 0; i < N; i++) {
			for (int j = 0; j < N; j++) {
				for (int k = 0; k < N; k++) {
					if ( i != j && j != k && k != i ) {
						int cost = 0;
						cost += 0;
						cost += Math.abs(As[i] - As[j]);
						cost += Math.abs(As[j] - As[k]);

//					System.out.println(i +","+ j + "," + k + "," + cost);
//
						if (cost < minCost) {
							minCost = cost;
						}
//
					}
				}
			}
		}

		System.out.println(minCost);
	}
}