function Main(input) {
  input = input.split("");
  let a = parseInt(input[0], 10);
  let b = parseInt(input[1], 10);
  let c = parseInt(input[2], 10);

  let arr = [a, b, c];
  arr.sort( () => {
    if( a < b ) return -1;
    if( a > b ) return 1;
    return 0;
  });

  let result1 = arr[1] - arr[0];
  let answer = arr[2] - result1;

  console.log(answer);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));