object Main {
  def main(args: Array[String]): Unit = {
    val p: Int = args.head.toInt
    val q: Int = args.tail.head.toInt
    val r: Int = args.tail.tail.head.toInt
    val min: Int = (abc _ :: acb _ :: bac _ :: bca _ :: cba _ :: cab _ :: Nil).map(_ (p, q, r)).min
    println(min)
  }

  def abc(p: Int, q: Int, r: Int) = p + q

  def acb(p: Int, q: Int, r: Int) = r + q

  def bac(p: Int, q: Int, r: Int) = p + r

  def bca(p: Int, q: Int, r: Int) = q + r

  def cba(p: Int, q: Int, r: Int) = q + p

  def cab(p: Int, q: Int, r: Int) = r + q
}
