fun main(args: Array<String>) {
  val sc = java.util.Scanner(System.`in`)
  val A = sc.nextInt()
  val B = sc.nextInt()
  val C = sc.nextInt()
  val abc = intArrayOf(A, B, C)
  val max = abc.max()!!
  val d = abc.map { max - it }.sum()
  if (d % 2 == 0) {
    println(d / 2)
  } else {
    println(d / 2 + 2)
  }
}
