https://www.acmicpc.net/problem/16204
import java.util.*; fun main(args: Array<String>) { val s=Scanner(System.`in`) var n=s.nextInt() var m=s.nextInt() var k=s.nextInt() print(Math.min(m,k)+Math.min(n-m,n-k)) }