n, m = list(map(int, input().split()))

p, s = [], []

for i in range(m):

    pi, si = input().split()

    p.append(int(pi))

    s.append(si)



lst_ac = [0 for i in range(n+1)]

for i in range(m):

    if s[i] == 'AC':

        lst_ac[p[i]] = 1

ans_ac = sum(lst_ac)



out = 0

for i in range(m):

    if s[i] == 'WA' and lst_ac[p[i]] == 1:

        out += 1

    if s[i] == 'AC' and lst_ac[p[i]] == 1:

        lst_ac[p[i]] = 2



print((ans_ac, out))
n, m = list(map(int, input().split()))

pena = [0 for i in range(n)]

cor = set([])

for i in range(m):

    pi, si = input().split()

    pi = int(pi) - 1

    if si == 'AC':

        cor.add(pi)

    else:

        if pi not in cor:

            pena[pi] += 1



ans = 0

for i in cor:

    ans += pena[i]

print((len(cor), ans))
n, m = list(map(int, input().split()))
p, s = [], []
for i in range(m):
    pi, si = input().split()
    p.append(int(pi))
    s.append(si)
lst_ac = [0 for i in range(n + 1)]
for i in range(m):
    if s[i] == "AC":
        lst_ac[p[i]] = 1
ans_ac = sum(lst_ac)
out = 0
for i in range(m):
    if s[i] == "WA" and lst_ac[p[i]] == 1:
        out += 1
    if s[i] == "AC" and lst_ac[p[i]] == 1:
        lst_ac[p[i]] = 2
print((ans_ac, out))

n, m = list(map(int, input().split()))
pena = [0 for i in range(n)]
cor = set([])
for i in range(m):
    pi, si = input().split()
    pi = int(pi) - 1
    if si == "AC":
        cor.add(pi)
    else:
        if pi not in cor:
            pena[pi] += 1
ans = 0
for i in cor:
    ans += pena[i]
print((len(cor), ans))

-p, s = [], [] +pena = [0 for i in range(n)] +cor = set([]) -    p.append(int(pi)) -    s.append(si) -lst_ac = [0 for i in range(n + 1)] -for i in range(m): -    if s[i] == "AC": -        lst_ac[p[i]] = 1 -ans_ac = sum(lst_ac) -out = 0 -for i in range(m): -    if s[i] == "WA" and lst_ac[p[i]] == 1: -        out += 1 -    if s[i] == "AC" and lst_ac[p[i]] == 1: -        lst_ac[p[i]] = 2 -print((ans_ac, out)) +    pi = int(pi) - 1 +    if si == "AC": +        cor.add(pi) +    else: +        if pi not in cor: +            pena[pi] += 1 +ans = 0 +for i in cor: +    ans += pena[i] +print((len(cor), ans))