import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val a, b, c = sc.nextInt()
    val max = Array(a, b, c).max
    val sum = Array(a, b, c).sum

    if ((max * 3 - sum) % 2 == 0) {
      println((max * 3 - sum) / 2)
    } else {
      println((max * 3 - sum) / 2 + 2)
    }
  }
}
