object Main extends App {
  val Array(a,b,c) = readLine.split(" ").map{_.toInt}
  
  if ((a+b)%2==0&&(b+c)%2==0&&(c+a)%2==0) {
    val Array(aa,bb,cc) = Array(a,b,c).sorted
    println((2*cc-aa-bb)/2)
  } else {
    val even = Array(a,b,c).filter{_%2==0}
    val odd = Array(a,b,c).filter{_%2==1}
    if (even.size==1) {
      val aa = even(0)
      val bb = odd(0)+1
      val cc = odd(1)+1
      val Array(aaa,bbb,ccc) = Array(aa,bb,cc).sorted
      println(1+(2*ccc-aaa-bbb)/2)
    } else {
      val aa = even(0) + 1
      val bb = even(1) + 1
      val cc = odd(0)
      val Array(aaa,bbb,ccc) = Array(aa,bb,cc).sorted
      println(1+(2*ccc-aaa-bbb)/2)
    }
  }
}