N = int(input()) a = list(map(int,input().split())) t = a.count(a[0]) k = N - t if t * 2 + k * 4 == a[0] + 2: print(t, k) else: print(k, t)