object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val minimalNum :: a :: b :: Nil = List.fill(3)(sc.nextInt()).sorted
  println(a + b - minimalNum * 2 - ((a - minimalNum).min(b - minimalNum) / 2) * 3)
}
