n=int(input()) a=list(map(int,input().split())) crane=turtle=0 for i in a: if i==4: turtle+=1 else: crane+=1 print(turtle,crane)