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