n = int(input()) a = list(map(int, input().split())) for i in range(n+1): if 2*i + 4*(n-i) == sum(a): print(i, n-i)