import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a[] = new int[3];
		for (int i = 0; i < 3; ++i)
			a[i] = sc.nextInt();
		sc.close();
		int ans = 1000, tmp = 0;
		for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < 3; ++j) {
				if (i != j) {
					tmp = Math.abs(a[i] - a[j]);
					for (int k = 0; k < 3; ++k) {
						int tmp2 = 0;
						if (i != k && j != k) {
							tmp2 = Math.abs(a[i] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
							tmp2 = Math.abs(a[j] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
						}
					}
				}
			}
		}
		System.out.println(ans);
	}

} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a[] = new int[3];
		for (int i = 0; i < 3; ++i)
			a[i] = sc.nextInt();
		sc.close();
		int ans = 1000, tmp = 0;
		for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < 3; ++j) {
				if (i != j) {
					tmp = Math.abs(a[i] - a[j]);
					for (int k = 0; k < 3; ++k) {
						int tmp2 = 0;
						if (i != k && j != k) {
							tmp2 = Math.abs(a[i] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
							tmp2 = Math.abs(a[j] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
						}
					}
				}
			}
		}
		System.out.println(ans);
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a[] = new int[3];
		for (int i = 0; i < 3; ++i)
			a[i] = sc.nextInt();
		sc.close();
		int ans = 1000, tmp = 0;
		for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < 3; ++j) {
				if (i != j) {
					tmp = Math.abs(a[i] - a[j]);
					for (int k = 0; k < 3; ++k) {
						int tmp2 = 0;
						if (i != k && j != k) {
							tmp2 = Math.abs(a[i] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
							tmp2 = Math.abs(a[j] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
						}
					}
				}
			}
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int a[] = new int[3];
		for (int i = 0; i < 3; ++i)
			a[i] = sc.nextInt();
		sc.close();
		int ans = 1000, tmp = 0;
		for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < 3; ++j) {
				if (i != j) {
					tmp = Math.abs(a[i] - a[j]);
					for (int k = 0; k < 3; ++k) {
						int tmp2 = 0;
						if (i != k && j != k) {
							tmp2 = Math.abs(a[i] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
							tmp2 = Math.abs(a[j] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
						}
					}
				}
			}
		}
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a[] = new int[3]; a new int[3] 3 for (int i = 0; i < 3; ++i)
			a[i] = sc.nextInt(); int i = 0; int i = 0; i 0 i < 3 i 3 ++i ++i i a[i] = sc.nextInt(); a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc sc.close() sc.close sc int ans = 1000 ans 1000 tmp = 0; tmp 0 for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < 3; ++j) {
				if (i != j) {
					tmp = Math.abs(a[i] - a[j]);
					for (int k = 0; k < 3; ++k) {
						int tmp2 = 0;
						if (i != k && j != k) {
							tmp2 = Math.abs(a[i] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
							tmp2 = Math.abs(a[j] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
						}
					}
				}
			}
		} 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) {
					tmp = Math.abs(a[i] - a[j]);
					for (int k = 0; k < 3; ++k) {
						int tmp2 = 0;
						if (i != k && j != k) {
							tmp2 = Math.abs(a[i] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
							tmp2 = Math.abs(a[j] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
						}
					}
				}
			}
		} {
			for (int j = 0; j < 3; ++j) {
				if (i != j) {
					tmp = Math.abs(a[i] - a[j]);
					for (int k = 0; k < 3; ++k) {
						int tmp2 = 0;
						if (i != k && j != k) {
							tmp2 = Math.abs(a[i] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
							tmp2 = Math.abs(a[j] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
						}
					}
				}
			}
		} for (int j = 0; j < 3; ++j) {
				if (i != j) {
					tmp = Math.abs(a[i] - a[j]);
					for (int k = 0; k < 3; ++k) {
						int tmp2 = 0;
						if (i != k && j != k) {
							tmp2 = Math.abs(a[i] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
							tmp2 = Math.abs(a[j] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
						}
					}
				}
			} int j = 0; int j = 0; j 0 j < 3 j 3 ++j ++j j {
				if (i != j) {
					tmp = Math.abs(a[i] - a[j]);
					for (int k = 0; k < 3; ++k) {
						int tmp2 = 0;
						if (i != k && j != k) {
							tmp2 = Math.abs(a[i] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
							tmp2 = Math.abs(a[j] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
						}
					}
				}
			} {
				if (i != j) {
					tmp = Math.abs(a[i] - a[j]);
					for (int k = 0; k < 3; ++k) {
						int tmp2 = 0;
						if (i != k && j != k) {
							tmp2 = Math.abs(a[i] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
							tmp2 = Math.abs(a[j] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
						}
					}
				}
			} if (i != j) {
					tmp = Math.abs(a[i] - a[j]);
					for (int k = 0; k < 3; ++k) {
						int tmp2 = 0;
						if (i != k && j != k) {
							tmp2 = Math.abs(a[i] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
							tmp2 = Math.abs(a[j] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
						}
					}
				} i != j i j {
					tmp = Math.abs(a[i] - a[j]);
					for (int k = 0; k < 3; ++k) {
						int tmp2 = 0;
						if (i != k && j != k) {
							tmp2 = Math.abs(a[i] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
							tmp2 = Math.abs(a[j] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
						}
					}
				} tmp = Math.abs(a[i] - a[j]) tmp Math.abs(a[i] - a[j]) Math.abs Math a[i] - a[j] a[i] a i a[j] a j for (int k = 0; k < 3; ++k) {
						int tmp2 = 0;
						if (i != k && j != k) {
							tmp2 = Math.abs(a[i] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
							tmp2 = Math.abs(a[j] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
						}
					} int k = 0; int k = 0; k 0 k < 3 k 3 ++k ++k k {
						int tmp2 = 0;
						if (i != k && j != k) {
							tmp2 = Math.abs(a[i] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
							tmp2 = Math.abs(a[j] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
						}
					} {
						int tmp2 = 0;
						if (i != k && j != k) {
							tmp2 = Math.abs(a[i] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
							tmp2 = Math.abs(a[j] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
						}
					} int tmp2 = 0; tmp2 0 if (i != k && j != k) {
							tmp2 = Math.abs(a[i] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
							tmp2 = Math.abs(a[j] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
						} i != k && j != k i != k i k j != k j k {
							tmp2 = Math.abs(a[i] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
							tmp2 = Math.abs(a[j] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
						} tmp2 = Math.abs(a[i] - a[k]) tmp2 Math.abs(a[i] - a[k]) Math.abs Math a[i] - a[k] a[i] a i a[k] a k ans = Math.min(ans, tmp + tmp2) ans Math.min(ans, tmp + tmp2) Math.min Math ans tmp + tmp2 tmp tmp2 tmp2 = Math.abs(a[j] - a[k]) tmp2 Math.abs(a[j] - a[k]) Math.abs Math a[j] - a[k] a[j] a j a[k] a k ans = Math.min(ans, tmp + tmp2) ans Math.min(ans, tmp + tmp2) Math.min Math ans tmp + tmp2 tmp tmp2 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a[] = new int[3];
		for (int i = 0; i < 3; ++i)
			a[i] = sc.nextInt();
		sc.close();
		int ans = 1000, tmp = 0;
		for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < 3; ++j) {
				if (i != j) {
					tmp = Math.abs(a[i] - a[j]);
					for (int k = 0; k < 3; ++k) {
						int tmp2 = 0;
						if (i != k && j != k) {
							tmp2 = Math.abs(a[i] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
							tmp2 = Math.abs(a[j] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
						}
					}
				}
			}
		}
		System.out.println(ans);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a[] = new int[3];
		for (int i = 0; i < 3; ++i)
			a[i] = sc.nextInt();
		sc.close();
		int ans = 1000, tmp = 0;
		for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < 3; ++j) {
				if (i != j) {
					tmp = Math.abs(a[i] - a[j]);
					for (int k = 0; k < 3; ++k) {
						int tmp2 = 0;
						if (i != k && j != k) {
							tmp2 = Math.abs(a[i] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
							tmp2 = Math.abs(a[j] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
						}
					}
				}
			}
		}
		System.out.println(ans);
	}

} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a[] = new int[3];
		for (int i = 0; i < 3; ++i)
			a[i] = sc.nextInt();
		sc.close();
		int ans = 1000, tmp = 0;
		for (int i = 0; i < 3; ++i) {
			for (int j = 0; j < 3; ++j) {
				if (i != j) {
					tmp = Math.abs(a[i] - a[j]);
					for (int k = 0; k < 3; ++k) {
						int tmp2 = 0;
						if (i != k && j != k) {
							tmp2 = Math.abs(a[i] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
							tmp2 = Math.abs(a[j] - a[k]);
							ans = Math.min(ans, tmp + tmp2);
						}
					}
				}
			}
		}
		System.out.println(ans);
	}

}
