/**
 * 
 */
import java.util.ArrayList;
import java.util.Scanner;

/**
 * @author User
 *
 */
public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int[] array = new int[3];
		array[0] = sc.nextInt();
		array[1] = sc.nextInt();
		array[2] = sc.nextInt();
		
		int minCost = 300;
		
		for(int i = 0; i < 3 ; i++) {
			int nextMinCost = 100;
			int nextMinNumber = 0;
			for(int j = 0; j < 3 ; j++) {
				int totalCost = 0;				
				if(j == i) {
					continue;
				}
				
				for(int z = 0; z < 3 ; z++) {
					if(z != i && z != j) {
						totalCost += Math.abs(array[j] - array[i]) + Math.abs(array[z] - array[j]);
					}
				}
				if(totalCost < minCost) {
					minCost = totalCost;
				}
			}	

		}
	
		// 出力
		System.out.println(minCost);
	}

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

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int[] array = new int[3];
		array[0] = sc.nextInt();
		array[1] = sc.nextInt();
		array[2] = sc.nextInt();
		
		int minCost = 300;
		
		for(int i = 0; i < 3 ; i++) {
			int nextMinCost = 100;
			int nextMinNumber = 0;
			for(int j = 0; j < 3 ; j++) {
				int totalCost = 0;				
				if(j == i) {
					continue;
				}
				
				for(int z = 0; z < 3 ; z++) {
					if(z != i && z != j) {
						totalCost += Math.abs(array[j] - array[i]) + Math.abs(array[z] - array[j]);
					}
				}
				if(totalCost < minCost) {
					minCost = totalCost;
				}
			}	

		}
	
		// 出力
		System.out.println(minCost);
	}

} Main /**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int[] array = new int[3];
		array[0] = sc.nextInt();
		array[1] = sc.nextInt();
		array[2] = sc.nextInt();
		
		int minCost = 300;
		
		for(int i = 0; i < 3 ; i++) {
			int nextMinCost = 100;
			int nextMinNumber = 0;
			for(int j = 0; j < 3 ; j++) {
				int totalCost = 0;				
				if(j == i) {
					continue;
				}
				
				for(int z = 0; z < 3 ; z++) {
					if(z != i && z != j) {
						totalCost += Math.abs(array[j] - array[i]) + Math.abs(array[z] - array[j]);
					}
				}
				if(totalCost < minCost) {
					minCost = totalCost;
				}
			}	

		}
	
		// 出力
		System.out.println(minCost);
	} main {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int[] array = new int[3];
		array[0] = sc.nextInt();
		array[1] = sc.nextInt();
		array[2] = sc.nextInt();
		
		int minCost = 300;
		
		for(int i = 0; i < 3 ; i++) {
			int nextMinCost = 100;
			int nextMinNumber = 0;
			for(int j = 0; j < 3 ; j++) {
				int totalCost = 0;				
				if(j == i) {
					continue;
				}
				
				for(int z = 0; z < 3 ; z++) {
					if(z != i && z != j) {
						totalCost += Math.abs(array[j] - array[i]) + Math.abs(array[z] - array[j]);
					}
				}
				if(totalCost < minCost) {
					minCost = totalCost;
				}
			}	

		}
	
		// 出力
		System.out.println(minCost);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] array = new int[3]; array new int[3] 3 array[0] = sc.nextInt() array[0] array 0 sc.nextInt() sc.nextInt sc array[1] = sc.nextInt() array[1] array 1 sc.nextInt() sc.nextInt sc array[2] = sc.nextInt() array[2] array 2 sc.nextInt() sc.nextInt sc int minCost = 300; minCost 300 for(int i = 0; i < 3 ; i++) {
			int nextMinCost = 100;
			int nextMinNumber = 0;
			for(int j = 0; j < 3 ; j++) {
				int totalCost = 0;				
				if(j == i) {
					continue;
				}
				
				for(int z = 0; z < 3 ; z++) {
					if(z != i && z != j) {
						totalCost += Math.abs(array[j] - array[i]) + Math.abs(array[z] - array[j]);
					}
				}
				if(totalCost < minCost) {
					minCost = totalCost;
				}
			}	

		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			int nextMinCost = 100;
			int nextMinNumber = 0;
			for(int j = 0; j < 3 ; j++) {
				int totalCost = 0;				
				if(j == i) {
					continue;
				}
				
				for(int z = 0; z < 3 ; z++) {
					if(z != i && z != j) {
						totalCost += Math.abs(array[j] - array[i]) + Math.abs(array[z] - array[j]);
					}
				}
				if(totalCost < minCost) {
					minCost = totalCost;
				}
			}	

		} {
			int nextMinCost = 100;
			int nextMinNumber = 0;
			for(int j = 0; j < 3 ; j++) {
				int totalCost = 0;				
				if(j == i) {
					continue;
				}
				
				for(int z = 0; z < 3 ; z++) {
					if(z != i && z != j) {
						totalCost += Math.abs(array[j] - array[i]) + Math.abs(array[z] - array[j]);
					}
				}
				if(totalCost < minCost) {
					minCost = totalCost;
				}
			}	

		} int nextMinCost = 100; nextMinCost 100 int nextMinNumber = 0; nextMinNumber 0 for(int j = 0; j < 3 ; j++) {
				int totalCost = 0;				
				if(j == i) {
					continue;
				}
				
				for(int z = 0; z < 3 ; z++) {
					if(z != i && z != j) {
						totalCost += Math.abs(array[j] - array[i]) + Math.abs(array[z] - array[j]);
					}
				}
				if(totalCost < minCost) {
					minCost = totalCost;
				}
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				int totalCost = 0;				
				if(j == i) {
					continue;
				}
				
				for(int z = 0; z < 3 ; z++) {
					if(z != i && z != j) {
						totalCost += Math.abs(array[j] - array[i]) + Math.abs(array[z] - array[j]);
					}
				}
				if(totalCost < minCost) {
					minCost = totalCost;
				}
			} {
				int totalCost = 0;				
				if(j == i) {
					continue;
				}
				
				for(int z = 0; z < 3 ; z++) {
					if(z != i && z != j) {
						totalCost += Math.abs(array[j] - array[i]) + Math.abs(array[z] - array[j]);
					}
				}
				if(totalCost < minCost) {
					minCost = totalCost;
				}
			} int totalCost = 0; totalCost 0 if(j == i) {
					continue;
				} j == i j i {
					continue;
				} continue; for(int z = 0; z < 3 ; z++) {
					if(z != i && z != j) {
						totalCost += Math.abs(array[j] - array[i]) + Math.abs(array[z] - array[j]);
					}
				} int z = 0; int z = 0; z 0 z < 3 z 3 z++ z++ z {
					if(z != i && z != j) {
						totalCost += Math.abs(array[j] - array[i]) + Math.abs(array[z] - array[j]);
					}
				} {
					if(z != i && z != j) {
						totalCost += Math.abs(array[j] - array[i]) + Math.abs(array[z] - array[j]);
					}
				} if(z != i && z != j) {
						totalCost += Math.abs(array[j] - array[i]) + Math.abs(array[z] - array[j]);
					} z != i && z != j z != i z i z != j z j {
						totalCost += Math.abs(array[j] - array[i]) + Math.abs(array[z] - array[j]);
					} totalCost += Math.abs(array[j] - array[i]) + Math.abs(array[z] - array[j]) totalCost Math.abs(array[j] - array[i]) + Math.abs(array[z] - array[j]) Math.abs(array[j] - array[i]) Math.abs Math array[j] - array[i] array[j] array j array[i] array i Math.abs(array[z] - array[j]) Math.abs Math array[z] - array[j] array[z] array z array[j] array j if(totalCost < minCost) {
					minCost = totalCost;
				} totalCost < minCost totalCost minCost {
					minCost = totalCost;
				} minCost = totalCost minCost totalCost System.out.println(minCost) System.out.println System.out System System.out minCost String[] args args public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int[] array = new int[3];
		array[0] = sc.nextInt();
		array[1] = sc.nextInt();
		array[2] = sc.nextInt();
		
		int minCost = 300;
		
		for(int i = 0; i < 3 ; i++) {
			int nextMinCost = 100;
			int nextMinNumber = 0;
			for(int j = 0; j < 3 ; j++) {
				int totalCost = 0;				
				if(j == i) {
					continue;
				}
				
				for(int z = 0; z < 3 ; z++) {
					if(z != i && z != j) {
						totalCost += Math.abs(array[j] - array[i]) + Math.abs(array[z] - array[j]);
					}
				}
				if(totalCost < minCost) {
					minCost = totalCost;
				}
			}	

		}
	
		// 出力
		System.out.println(minCost);
	}

} public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int[] array = new int[3];
		array[0] = sc.nextInt();
		array[1] = sc.nextInt();
		array[2] = sc.nextInt();
		
		int minCost = 300;
		
		for(int i = 0; i < 3 ; i++) {
			int nextMinCost = 100;
			int nextMinNumber = 0;
			for(int j = 0; j < 3 ; j++) {
				int totalCost = 0;				
				if(j == i) {
					continue;
				}
				
				for(int z = 0; z < 3 ; z++) {
					if(z != i && z != j) {
						totalCost += Math.abs(array[j] - array[i]) + Math.abs(array[z] - array[j]);
					}
				}
				if(totalCost < minCost) {
					minCost = totalCost;
				}
			}	

		}
	
		// 出力
		System.out.println(minCost);
	}

} Main
/**
 * 
 */
import java.util.ArrayList;
import java.util.Scanner;

/**
 * @author User
 *
 */
public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int[] array = new int[3];
		array[0] = sc.nextInt();
		array[1] = sc.nextInt();
		array[2] = sc.nextInt();
		
		int minCost = 300;
		
		for(int i = 0; i < 3 ; i++) {
			int nextMinCost = 100;
			int nextMinNumber = 0;
			for(int j = 0; j < 3 ; j++) {
				int totalCost = 0;				
				if(j == i) {
					continue;
				}
				
				for(int z = 0; z < 3 ; z++) {
					if(z != i && z != j) {
						totalCost += Math.abs(array[j] - array[i]) + Math.abs(array[z] - array[j]);
					}
				}
				if(totalCost < minCost) {
					minCost = totalCost;
				}
			}	

		}
	
		// 出力
		System.out.println(minCost);
	}

}
