# -*- coding: utf-8 -*-

N = int(raw_input())
cont = 0

for i in range(N):
    X = int(raw_input())
    if (X >= 10 and X <= 20):
        cont = cont + 1

print("%d in" % cont)
print("%d out" % (N-cont))
