N = int(input())
S = []
C0 = 0
C1 = 0
C2 = 0
C3 = 0

for i in range(N-1):
    S = input()
    if S == AC:
        C0 = C0 + 1
    elif S == WA:
        C1 = C1 + 1
    elif SA == TLE:
        C2 = C2 + 1
    else:
        C3 = C3 + 1

print(C0, C1, C2, C3)
    