import java.util.Scanner; public class Yuki4 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int leg[] = new int[n]; int x = 0; int y = 0; int z = -1; for (int i = 0; i < n; i++) { leg[i] = scan.nextInt(); } for (int i = 0; i < n; i++) { if (leg[0] == leg[i]) x++; else z = i; } y = n - x; if (2 * x + 4 * y == leg[0] + 2) { if (z == -1) System.out.println(x + " " + y); else if (2 * x + 4 * y == leg[z] + 4) System.out.println(x + " " + y); } else System.out.println(y + " " + x); } }