object Main extends App {
  
  val sc = new java.util.Scanner(System.in)
  val array = Array.fill(3)(sc.nextInt()).sorted
  val diff = array(2) - array(0) + array(2) - array(1)
  if (diff % 2 == 0) {
    println(diff / 2)
  } else {
    println(diff / 2 + 2)
  }
}
