n=int(input()) t=0 k=0 list=[int(i) for i in input().split()] for i in range(n): if list[i]==2: t=t+1 else: k=k+1 i=i+1 print(str(k)+" "+str(t))