#include<stdio.h>

x = int(input())

d = 0
f = 0

for x in range(0, x):
    n = int(input())

    if n >= 10  and n <= 20:
        d += 1
    else:
        f += 1

print('%d in' %(d))
print('%d out' %(f))