import java.util.Scanner; public class Run { public static void main (String arg[]) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int a = scan.nextInt(); int b; int x = 1; boolean flag = true; for (int i = 0; i < N -1; i++) { b = scan.nextInt(); if (a == b) x++; else if (flag && a < b) flag = false; } if (x == N||x*2 -2 !=a) flag = false; if (!flag) x = N - x; System.out.printf("%d %d", x, N-x); } }