https://www.acmicpc.net/problem/16204
using System;
class Program
{
static void Main() {
string[] s=Console.ReadLine().Split(' ');
int n=int.Parse(s[0]),m=int.Parse(s[1]),k=int.Parse(s[2]);
Console.Write(Math.Min(m,k)+Math.Min(n-m,n-k));
}
}