object Main extends App {
  val sc = new java.util.Scanner(System.in)
  var Array(a, b, c) = Array.fill(3)(sc.nextInt()).sorted
  var ans = 0
  ans += c - b
  val d = c - (a + (c - b))
  ans += (if (d % 2 == 0) d / 2 else (d / 2) + 2)
  println(ans)
}
