import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    //nextLineとnextを同時に使ったら死ぬ
    val sc = new Scanner(System.in)

    val a, b, c = sc.nextInt()
    val nums = Array(a, b, c).sorted.reverse

    val max = nums.head
    val ans =
      if ((max * 3 - nums.sum) % 2 == 0) (max * 3 - nums.sum) / 2
      else (max * 3 - nums.sum) / 2 + 2

    println(ans)
  }
  def debug(args: Any*): Unit = {
    Console.err.println(args.mkString(" "))
  }
}

