import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int[] a = new int[3];
		sc.fill(a);

		int min = Integer.MAX_VALUE;
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (i == j) {
					continue;
				}
				for (int k = 0; k < 3; k++) {
					if (i == k || j == k) {
						continue;
					}

					debug(a[i], a[j], a[k], Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));

					min = Math.min(min, Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));
				}
			}
		}

		System.out.println(min);
	}

	private static boolean isDebug = System.getProperty("sun.desktop") != null;

	private static void debug(Object... o) {
		if (isDebug) {
			System.err.println(Arrays.deepToString(o));
		}
	}

	public static class Scanner {
		private BufferedInputStream inputStream;
		private StringBuilder buffer = new StringBuilder();

		public Scanner(InputStream in) {
			inputStream = new BufferedInputStream(in);
		}

		public int nextInt() throws IOException {
			int num = 0;
			int sign = 1;

			int read = skip();
			if (read == '-') {
				sign = -1;
				read = inputStream.read();
			}

			do {
				num = num * 10 + sign * (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(int[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
			}
		}

		public void fill(int[] a, int[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
				b[i] = nextInt();
			}
		}

		public long nextLong() throws IOException {
			long num = 0;
			int sign = 1;

			int read = skip();
			if (read == '-') {
				sign = -1;
				read = inputStream.read();
			}

			do {
				num = num * 10 + sign * (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(long[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
			}
		}

		public void fill(long[] a, long[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
				b[i] = nextLong();
			}
		}

		public long[] nextLong(int n) throws IOException {
			long[] array = new long[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextLong();
			}

			return array;
		}

		public String next() throws IOException {
			int read = skip();
			do {
				buffer.append((char) read);
			} while ((read = inputStream.read()) > 0x20);

			String text = buffer.toString();
			buffer.delete(0, buffer.length());

			return text;
		}

		private int skip() throws IOException {
			int read;
			while ((read = inputStream.read()) <= 0x20)
				;

			return read;
		}
	}
} import java.io.BufferedInputStream; BufferedInputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.util.Arrays; Arrays java.util public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int[] a = new int[3];
		sc.fill(a);

		int min = Integer.MAX_VALUE;
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (i == j) {
					continue;
				}
				for (int k = 0; k < 3; k++) {
					if (i == k || j == k) {
						continue;
					}

					debug(a[i], a[j], a[k], Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));

					min = Math.min(min, Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));
				}
			}
		}

		System.out.println(min);
	}

	private static boolean isDebug = System.getProperty("sun.desktop") != null;

	private static void debug(Object... o) {
		if (isDebug) {
			System.err.println(Arrays.deepToString(o));
		}
	}

	public static class Scanner {
		private BufferedInputStream inputStream;
		private StringBuilder buffer = new StringBuilder();

		public Scanner(InputStream in) {
			inputStream = new BufferedInputStream(in);
		}

		public int nextInt() throws IOException {
			int num = 0;
			int sign = 1;

			int read = skip();
			if (read == '-') {
				sign = -1;
				read = inputStream.read();
			}

			do {
				num = num * 10 + sign * (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(int[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
			}
		}

		public void fill(int[] a, int[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
				b[i] = nextInt();
			}
		}

		public long nextLong() throws IOException {
			long num = 0;
			int sign = 1;

			int read = skip();
			if (read == '-') {
				sign = -1;
				read = inputStream.read();
			}

			do {
				num = num * 10 + sign * (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(long[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
			}
		}

		public void fill(long[] a, long[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
				b[i] = nextLong();
			}
		}

		public long[] nextLong(int n) throws IOException {
			long[] array = new long[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextLong();
			}

			return array;
		}

		public String next() throws IOException {
			int read = skip();
			do {
				buffer.append((char) read);
			} while ((read = inputStream.read()) > 0x20);

			String text = buffer.toString();
			buffer.delete(0, buffer.length());

			return text;
		}

		private int skip() throws IOException {
			int read;
			while ((read = inputStream.read()) <= 0x20)
				;

			return read;
		}
	}
} Main private static boolean isDebug = System.getProperty("sun.desktop") != null; isDebug System.getProperty("sun.desktop") != null System.getProperty("sun.desktop") System.getProperty System "sun.desktop" null public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int[] a = new int[3];
		sc.fill(a);

		int min = Integer.MAX_VALUE;
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (i == j) {
					continue;
				}
				for (int k = 0; k < 3; k++) {
					if (i == k || j == k) {
						continue;
					}

					debug(a[i], a[j], a[k], Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));

					min = Math.min(min, Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));
				}
			}
		}

		System.out.println(min);
	} main {
		Scanner sc = new Scanner(System.in);
		int[] a = new int[3];
		sc.fill(a);

		int min = Integer.MAX_VALUE;
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (i == j) {
					continue;
				}
				for (int k = 0; k < 3; k++) {
					if (i == k || j == k) {
						continue;
					}

					debug(a[i], a[j], a[k], Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));

					min = Math.min(min, Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));
				}
			}
		}

		System.out.println(min);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] a = new int[3]; a new int[3] 3 sc.fill(a) sc.fill sc a int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (i == j) {
					continue;
				}
				for (int k = 0; k < 3; k++) {
					if (i == k || j == k) {
						continue;
					}

					debug(a[i], a[j], a[k], Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));

					min = Math.min(min, Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));
				}
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			for (int j = 0; j < 3; j++) {
				if (i == j) {
					continue;
				}
				for (int k = 0; k < 3; k++) {
					if (i == k || j == k) {
						continue;
					}

					debug(a[i], a[j], a[k], Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));

					min = Math.min(min, Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));
				}
			}
		} {
			for (int j = 0; j < 3; j++) {
				if (i == j) {
					continue;
				}
				for (int k = 0; k < 3; k++) {
					if (i == k || j == k) {
						continue;
					}

					debug(a[i], a[j], a[k], Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));

					min = Math.min(min, Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));
				}
			}
		} for (int j = 0; j < 3; j++) {
				if (i == j) {
					continue;
				}
				for (int k = 0; k < 3; k++) {
					if (i == k || j == k) {
						continue;
					}

					debug(a[i], a[j], a[k], Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));

					min = Math.min(min, Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));
				}
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				if (i == j) {
					continue;
				}
				for (int k = 0; k < 3; k++) {
					if (i == k || j == k) {
						continue;
					}

					debug(a[i], a[j], a[k], Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));

					min = Math.min(min, Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));
				}
			} {
				if (i == j) {
					continue;
				}
				for (int k = 0; k < 3; k++) {
					if (i == k || j == k) {
						continue;
					}

					debug(a[i], a[j], a[k], Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));

					min = Math.min(min, Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));
				}
			} if (i == j) {
					continue;
				} i == j i j {
					continue;
				} continue; for (int k = 0; k < 3; k++) {
					if (i == k || j == k) {
						continue;
					}

					debug(a[i], a[j], a[k], Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));

					min = Math.min(min, Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));
				} int k = 0; int k = 0; k 0 k < 3 k 3 k++ k++ k {
					if (i == k || j == k) {
						continue;
					}

					debug(a[i], a[j], a[k], Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));

					min = Math.min(min, Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));
				} {
					if (i == k || j == k) {
						continue;
					}

					debug(a[i], a[j], a[k], Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));

					min = Math.min(min, Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));
				} if (i == k || j == k) {
						continue;
					} i == k || j == k i == k i k j == k j k {
						continue;
					} continue; debug(a[i], a[j], a[k], Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k])) debug a[i] a i a[j] a j a[k] a k Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]) Math.abs(a[i] - a[j]) Math.abs Math a[i] - a[j] a[i] a i a[j] a j Math.abs(a[j] - a[k]) Math.abs Math a[j] - a[k] a[j] a j a[k] a k min = Math.min(min, Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k])) min Math.min(min, Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k])) Math.min Math min Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]) Math.abs(a[i] - a[j]) Math.abs Math a[i] - a[j] a[i] a i a[j] a j Math.abs(a[j] - a[k]) Math.abs Math a[j] - a[k] a[j] a j a[k] a k System.out.println(min) System.out.println System.out System System.out min String[] args args private static void debug(Object... o) {
		if (isDebug) {
			System.err.println(Arrays.deepToString(o));
		}
	} debug {
		if (isDebug) {
			System.err.println(Arrays.deepToString(o));
		}
	} if (isDebug) {
			System.err.println(Arrays.deepToString(o));
		} isDebug {
			System.err.println(Arrays.deepToString(o));
		} System.err.println(Arrays.deepToString(o)) System.err.println System.err System System.err Arrays.deepToString(o) Arrays.deepToString Arrays o Object... o o public static class Scanner {
		private BufferedInputStream inputStream;
		private StringBuilder buffer = new StringBuilder();

		public Scanner(InputStream in) {
			inputStream = new BufferedInputStream(in);
		}

		public int nextInt() throws IOException {
			int num = 0;
			int sign = 1;

			int read = skip();
			if (read == '-') {
				sign = -1;
				read = inputStream.read();
			}

			do {
				num = num * 10 + sign * (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(int[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
			}
		}

		public void fill(int[] a, int[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
				b[i] = nextInt();
			}
		}

		public long nextLong() throws IOException {
			long num = 0;
			int sign = 1;

			int read = skip();
			if (read == '-') {
				sign = -1;
				read = inputStream.read();
			}

			do {
				num = num * 10 + sign * (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(long[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
			}
		}

		public void fill(long[] a, long[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
				b[i] = nextLong();
			}
		}

		public long[] nextLong(int n) throws IOException {
			long[] array = new long[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextLong();
			}

			return array;
		}

		public String next() throws IOException {
			int read = skip();
			do {
				buffer.append((char) read);
			} while ((read = inputStream.read()) > 0x20);

			String text = buffer.toString();
			buffer.delete(0, buffer.length());

			return text;
		}

		private int skip() throws IOException {
			int read;
			while ((read = inputStream.read()) <= 0x20)
				;

			return read;
		}
	} Scanner private BufferedInputStream inputStream; inputStream private StringBuilder buffer = new StringBuilder(); buffer new StringBuilder() public Scanner(InputStream in) {
			inputStream = new BufferedInputStream(in);
		} Scanner {
			inputStream = new BufferedInputStream(in);
		} inputStream = new BufferedInputStream(in) inputStream new BufferedInputStream(in) InputStream in in public int nextInt() throws IOException {
			int num = 0;
			int sign = 1;

			int read = skip();
			if (read == '-') {
				sign = -1;
				read = inputStream.read();
			}

			do {
				num = num * 10 + sign * (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		} nextInt {
			int num = 0;
			int sign = 1;

			int read = skip();
			if (read == '-') {
				sign = -1;
				read = inputStream.read();
			}

			do {
				num = num * 10 + sign * (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		} int num = 0; num 0 int sign = 1; sign 1 int read = skip(); read skip() skip if (read == '-') {
				sign = -1;
				read = inputStream.read();
			} read == '-' read '-' {
				sign = -1;
				read = inputStream.read();
			} sign = -1 sign -1 1 read = inputStream.read() read inputStream.read() inputStream.read inputStream do {
				num = num * 10 + sign * (read - 0x30);
			} while ((read = inputStream.read()) > 0x20); (read = inputStream.read()) > 0x20 (read = inputStream.read()) read inputStream.read() inputStream.read inputStream 0x20 {
				num = num * 10 + sign * (read - 0x30);
			} num = num * 10 + sign * (read - 0x30) num num * 10 + sign * (read - 0x30) num * 10 num 10 sign * (read - 0x30) sign (read - 0x30) read 0x30 return num; num public void fill(int[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
			}
		} fill {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
			}
		} for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
			} int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
				a[i] = nextInt();
			} {
				a[i] = nextInt();
			} a[i] = nextInt() a[i] a i nextInt() nextInt int[] a a public void fill(int[] a, int[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
				b[i] = nextInt();
			}
		} fill {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
				b[i] = nextInt();
			}
		} if (a.length != b.length) {
				throw new IllegalArgumentException();
			} a.length != b.length a.length a a.length b.length b b.length {
				throw new IllegalArgumentException();
			} throw new IllegalArgumentException(); new IllegalArgumentException() for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
				b[i] = nextInt();
			} int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
				a[i] = nextInt();
				b[i] = nextInt();
			} {
				a[i] = nextInt();
				b[i] = nextInt();
			} a[i] = nextInt() a[i] a i nextInt() nextInt b[i] = nextInt() b[i] b i nextInt() nextInt int[] a a int[] b b public long nextLong() throws IOException {
			long num = 0;
			int sign = 1;

			int read = skip();
			if (read == '-') {
				sign = -1;
				read = inputStream.read();
			}

			do {
				num = num * 10 + sign * (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		} nextLong {
			long num = 0;
			int sign = 1;

			int read = skip();
			if (read == '-') {
				sign = -1;
				read = inputStream.read();
			}

			do {
				num = num * 10 + sign * (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		} long num = 0; num 0 int sign = 1; sign 1 int read = skip(); read skip() skip if (read == '-') {
				sign = -1;
				read = inputStream.read();
			} read == '-' read '-' {
				sign = -1;
				read = inputStream.read();
			} sign = -1 sign -1 1 read = inputStream.read() read inputStream.read() inputStream.read inputStream do {
				num = num * 10 + sign * (read - 0x30);
			} while ((read = inputStream.read()) > 0x20); (read = inputStream.read()) > 0x20 (read = inputStream.read()) read inputStream.read() inputStream.read inputStream 0x20 {
				num = num * 10 + sign * (read - 0x30);
			} num = num * 10 + sign * (read - 0x30) num num * 10 + sign * (read - 0x30) num * 10 num 10 sign * (read - 0x30) sign (read - 0x30) read 0x30 return num; num public void fill(long[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
			}
		} fill {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
			}
		} for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
			} int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
				a[i] = nextLong();
			} {
				a[i] = nextLong();
			} a[i] = nextLong() a[i] a i nextLong() nextLong long[] a a public void fill(long[] a, long[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
				b[i] = nextLong();
			}
		} fill {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
				b[i] = nextLong();
			}
		} if (a.length != b.length) {
				throw new IllegalArgumentException();
			} a.length != b.length a.length a a.length b.length b b.length {
				throw new IllegalArgumentException();
			} throw new IllegalArgumentException(); new IllegalArgumentException() for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
				b[i] = nextLong();
			} int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
				a[i] = nextLong();
				b[i] = nextLong();
			} {
				a[i] = nextLong();
				b[i] = nextLong();
			} a[i] = nextLong() a[i] a i nextLong() nextLong b[i] = nextLong() b[i] b i nextLong() nextLong long[] a a long[] b b public long[] nextLong(int n) throws IOException {
			long[] array = new long[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextLong();
			}

			return array;
		} nextLong {
			long[] array = new long[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextLong();
			}

			return array;
		} long[] array = new long[n]; array new long[n] n for (int i = 0; i < n; i++) {
				array[i] = nextLong();
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				array[i] = nextLong();
			} {
				array[i] = nextLong();
			} array[i] = nextLong() array[i] array i nextLong() nextLong return array; array int n n public String next() throws IOException {
			int read = skip();
			do {
				buffer.append((char) read);
			} while ((read = inputStream.read()) > 0x20);

			String text = buffer.toString();
			buffer.delete(0, buffer.length());

			return text;
		} next {
			int read = skip();
			do {
				buffer.append((char) read);
			} while ((read = inputStream.read()) > 0x20);

			String text = buffer.toString();
			buffer.delete(0, buffer.length());

			return text;
		} int read = skip(); read skip() skip do {
				buffer.append((char) read);
			} while ((read = inputStream.read()) > 0x20); (read = inputStream.read()) > 0x20 (read = inputStream.read()) read inputStream.read() inputStream.read inputStream 0x20 {
				buffer.append((char) read);
			} buffer.append((char) read) buffer.append buffer (char) read String text = buffer.toString(); text buffer.toString() buffer.toString buffer buffer.delete(0, buffer.length()) buffer.delete buffer 0 buffer.length() buffer.length buffer return text; text private int skip() throws IOException {
			int read;
			while ((read = inputStream.read()) <= 0x20)
				;

			return read;
		} skip {
			int read;
			while ((read = inputStream.read()) <= 0x20)
				;

			return read;
		} int read; read while ((read = inputStream.read()) <= 0x20)
				; (read = inputStream.read()) <= 0x20 (read = inputStream.read()) read inputStream.read() inputStream.read inputStream 0x20 return read; read public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int[] a = new int[3];
		sc.fill(a);

		int min = Integer.MAX_VALUE;
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (i == j) {
					continue;
				}
				for (int k = 0; k < 3; k++) {
					if (i == k || j == k) {
						continue;
					}

					debug(a[i], a[j], a[k], Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));

					min = Math.min(min, Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));
				}
			}
		}

		System.out.println(min);
	}

	private static boolean isDebug = System.getProperty("sun.desktop") != null;

	private static void debug(Object... o) {
		if (isDebug) {
			System.err.println(Arrays.deepToString(o));
		}
	}

	public static class Scanner {
		private BufferedInputStream inputStream;
		private StringBuilder buffer = new StringBuilder();

		public Scanner(InputStream in) {
			inputStream = new BufferedInputStream(in);
		}

		public int nextInt() throws IOException {
			int num = 0;
			int sign = 1;

			int read = skip();
			if (read == '-') {
				sign = -1;
				read = inputStream.read();
			}

			do {
				num = num * 10 + sign * (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(int[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
			}
		}

		public void fill(int[] a, int[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
				b[i] = nextInt();
			}
		}

		public long nextLong() throws IOException {
			long num = 0;
			int sign = 1;

			int read = skip();
			if (read == '-') {
				sign = -1;
				read = inputStream.read();
			}

			do {
				num = num * 10 + sign * (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(long[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
			}
		}

		public void fill(long[] a, long[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
				b[i] = nextLong();
			}
		}

		public long[] nextLong(int n) throws IOException {
			long[] array = new long[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextLong();
			}

			return array;
		}

		public String next() throws IOException {
			int read = skip();
			do {
				buffer.append((char) read);
			} while ((read = inputStream.read()) > 0x20);

			String text = buffer.toString();
			buffer.delete(0, buffer.length());

			return text;
		}

		private int skip() throws IOException {
			int read;
			while ((read = inputStream.read()) <= 0x20)
				;

			return read;
		}
	}
} public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int[] a = new int[3];
		sc.fill(a);

		int min = Integer.MAX_VALUE;
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (i == j) {
					continue;
				}
				for (int k = 0; k < 3; k++) {
					if (i == k || j == k) {
						continue;
					}

					debug(a[i], a[j], a[k], Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));

					min = Math.min(min, Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));
				}
			}
		}

		System.out.println(min);
	}

	private static boolean isDebug = System.getProperty("sun.desktop") != null;

	private static void debug(Object... o) {
		if (isDebug) {
			System.err.println(Arrays.deepToString(o));
		}
	}

	public static class Scanner {
		private BufferedInputStream inputStream;
		private StringBuilder buffer = new StringBuilder();

		public Scanner(InputStream in) {
			inputStream = new BufferedInputStream(in);
		}

		public int nextInt() throws IOException {
			int num = 0;
			int sign = 1;

			int read = skip();
			if (read == '-') {
				sign = -1;
				read = inputStream.read();
			}

			do {
				num = num * 10 + sign * (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(int[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
			}
		}

		public void fill(int[] a, int[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
				b[i] = nextInt();
			}
		}

		public long nextLong() throws IOException {
			long num = 0;
			int sign = 1;

			int read = skip();
			if (read == '-') {
				sign = -1;
				read = inputStream.read();
			}

			do {
				num = num * 10 + sign * (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(long[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
			}
		}

		public void fill(long[] a, long[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
				b[i] = nextLong();
			}
		}

		public long[] nextLong(int n) throws IOException {
			long[] array = new long[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextLong();
			}

			return array;
		}

		public String next() throws IOException {
			int read = skip();
			do {
				buffer.append((char) read);
			} while ((read = inputStream.read()) > 0x20);

			String text = buffer.toString();
			buffer.delete(0, buffer.length());

			return text;
		}

		private int skip() throws IOException {
			int read;
			while ((read = inputStream.read()) <= 0x20)
				;

			return read;
		}
	}
} Main
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int[] a = new int[3];
		sc.fill(a);

		int min = Integer.MAX_VALUE;
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (i == j) {
					continue;
				}
				for (int k = 0; k < 3; k++) {
					if (i == k || j == k) {
						continue;
					}

					debug(a[i], a[j], a[k], Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));

					min = Math.min(min, Math.abs(a[i] - a[j]) + Math.abs(a[j] - a[k]));
				}
			}
		}

		System.out.println(min);
	}

	private static boolean isDebug = System.getProperty("sun.desktop") != null;

	private static void debug(Object... o) {
		if (isDebug) {
			System.err.println(Arrays.deepToString(o));
		}
	}

	public static class Scanner {
		private BufferedInputStream inputStream;
		private StringBuilder buffer = new StringBuilder();

		public Scanner(InputStream in) {
			inputStream = new BufferedInputStream(in);
		}

		public int nextInt() throws IOException {
			int num = 0;
			int sign = 1;

			int read = skip();
			if (read == '-') {
				sign = -1;
				read = inputStream.read();
			}

			do {
				num = num * 10 + sign * (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(int[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
			}
		}

		public void fill(int[] a, int[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
				b[i] = nextInt();
			}
		}

		public long nextLong() throws IOException {
			long num = 0;
			int sign = 1;

			int read = skip();
			if (read == '-') {
				sign = -1;
				read = inputStream.read();
			}

			do {
				num = num * 10 + sign * (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(long[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
			}
		}

		public void fill(long[] a, long[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
				b[i] = nextLong();
			}
		}

		public long[] nextLong(int n) throws IOException {
			long[] array = new long[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextLong();
			}

			return array;
		}

		public String next() throws IOException {
			int read = skip();
			do {
				buffer.append((char) read);
			} while ((read = inputStream.read()) > 0x20);

			String text = buffer.toString();
			buffer.delete(0, buffer.length());

			return text;
		}

		private int skip() throws IOException {
			int read;
			while ((read = inputStream.read()) <= 0x20)
				;

			return read;
		}
	}
}
