import scala.io.StdIn

object Main extends App {
  val Array(min, mid, max) = StdIn.readLine().trim.split(" ").map(_.toInt).sorted

  val x = if(((3*max) % 2) == (min + mid + max) % 2){
    max
  } else max + 1
  
  println((3*x - (min + mid + max)) / 2)
}