n=int(input()) t,k=0,0 for i in map(int,input().split()): if i==2: k+=1 else: t+=1 print(t,k)