n = int(input()) l = list(map(int, input().split())) c = 0 t = 0 for i in l: if i % 4 == 0: c += 1 elif i % 2 == 0: t += 1 print(c, t)