// Arup Guha
// 3/13/2019
// Solution to 2019 February USACO Silver Problem: Sleepy Cow Herding
// Note: It's possible that my reverse code is unnecessary...it was something I was trying out
//       when trying to find my error with minimum. I've left it in, just in case.

import java.util.*;
import java.io.*;

public class herding {
	
	public static void main(String[] args) throws Exception {
	
		// Get positions.
		BufferedReader stdin = new BufferedReader(new FileReader("herding.in"));
		int n = Integer.parseInt(stdin.readLine().trim());
		int[] list = new int[n];
		for (int i=0; i<n; i++)
			list[i] = Integer.parseInt(stdin.readLine().trim());
		Arrays.sort(list);
		
		// Output results.
		PrintWriter out = new PrintWriter(new FileWriter("herding.out"));
		out.println(min(list));
		out.println(max(list));
		out.close();
		stdin.close();	
	}
	
	// Pre-condition: list is sorted.
	// Post-conditions: returns the minimum number of jumps to get consecutive.
	public static int min(int[] list) {
		
		int n = list.length;
		
		// Screen out 0 case - all consecutive.
		if (list[n-1] - list[0] == n-1) return 0;
		
		// One hole to jump into.
		if (list[n-1] - list[0] == n) return 1;
		
		// Screen out 1 case - n-1 numbers in n slots (hole to jump into for an endpoint)
		if (list[n-2] - list[0] == n-1 || list[n-1] - list[1] == n-1) return 1;
		
		// Even though n-1 consecutive, you can't get the last one inside, so 2 moves.
		if (list[n-2] - list[0] == n-2 || list[n-1] - list[1] == n-2) return 2;
		
		// Look for most dense area. We will jump into this.
		int max = getMax(list);
		
		// Create reverse list.
		int[] revlist = new int[n];
		for (int i=0; i<n; i++) 
			revlist[i] = list[n-1-i];
		
		// Run it the other way.
		max = Math.max(max, getMax(revlist));
		
		// We can fill up everything from the outside of the most dense run of size n-1.
		return n - max;
	}
	
	// Returns the maximum number of elements in list contained in a span of n-1, what we have to jump into.
	public static int getMax(int[] list) {
		int low = 0, high = 0, max = 1, n = list.length;
		while (high < n) {
			
			if (Math.abs(list[high] - list[low]) <= n-1) {
				max = Math.max(max, high-low+1);
				high++;
			}
			else {
				low++;
			}
		}
		return max;
	}
	
	// Pre-condition: list is sorted.
	// Post-conditions: returns the maximum number of jumps to get consecutive.
	public static int max(int[] list) {
		
		// This is easy; just jump into larger of the two gaps (0,n-2) or (1,n-1) and leap frog.
		int n = list.length;
		return Math.max(list[n-2]-list[0]-(n-2), list[n-1]-list[1]-(n-2));
	}	
}