N = int(input()) A = list(map(int, input().split())) ans = [0, 0] if len(set(A)) == 2: ma = max(A) for a in A: if ma - a == 2: ans[0] += 1 else: ans[1] += 1 else: if A[0] == (N - 1) * 2: ans[0] = N else: ans[1] = N print(*ans)