import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val p = sc.nextInt()
    val q = sc.nextInt()
    val r = sc.nextInt()

    abc129a(p, q, r)
}

fun abc129a(p: Int, q: Int, r: Int) {
    var list: MutableList<Int> = mutableListOf()
    list.add(p)
    list.add(q)
    list.add(r)
    var ans = list.sorted().take(2).sum()

    println(ans)
}
