using System; using System.Linq; class Program { static void Main(string[] args) { int N = int.Parse(Console.ReadLine()); int[] a = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray(); int leg = 0, tsuru = 0, kame = 0; leg = a.Max() / 2; kame = leg - (N - 1); leg = a.Min() / 2; if (kame < leg - (N - 1)) { kame = leg - (N - 1); } tsuru = N - kame; Console.WriteLine("{0} {1}", tsuru, kame); } }