N, M = list(map(int, input().split()))

pnt = {}

ac = {}

for i in range(M):

	p,s = input().split()

	p = int(p)

	if not p in pnt:

		pnt[p] = 0

		ac[p] = 0

	if s == "WA" and ac[p] == 0:

		pnt[p] += 1

	elif s == "AC" and ac[p] == 0:

		ac[p] += 1



for i in pnt:

	if pnt[i] != 0 and ac[i] == 0:

		pnt[i] = 0



print((sum(ac.values()),sum(pnt.values())))
N,M = list(map(int,input().split()))



ac = 0

wa = 0

acs = [0]*(N+1)

was = [0]*(N+1)



for i in range(M):

	p,s = input().split()

	p = int(p)

	if s == "AC":

		if acs[p]==0:

			ac += 1

			wa += was[p]

			acs[p] = 1

	else:

		was[p] += 1



print((ac,wa))
N, M = list(map(int, input().split()))
pnt = {}
ac = {}
for i in range(M):
    p, s = input().split()
    p = int(p)
    if not p in pnt:
        pnt[p] = 0
        ac[p] = 0
    if s == "WA" and ac[p] == 0:
        pnt[p] += 1
    elif s == "AC" and ac[p] == 0:
        ac[p] += 1
for i in pnt:
    if pnt[i] != 0 and ac[i] == 0:
        pnt[i] = 0
print((sum(ac.values()), sum(pnt.values())))

N, M = list(map(int, input().split()))
ac = 0
wa = 0
acs = [0] * (N + 1)
was = [0] * (N + 1)
for i in range(M):
    p, s = input().split()
    p = int(p)
    if s == "AC":
        if acs[p] == 0:
            ac += 1
            wa += was[p]
            acs[p] = 1
    else:
        was[p] += 1
print((ac, wa))

-pnt = {} -ac = {} +ac = 0 +wa = 0 +acs = [0] * (N + 1) +was = [0] * (N + 1) -    if not p in pnt: -        pnt[p] = 0 -        ac[p] = 0 -    if s == "WA" and ac[p] == 0: -        pnt[p] += 1 -    elif s == "AC" and ac[p] == 0: -        ac[p] += 1 -for i in pnt: -    if pnt[i] != 0 and ac[i] == 0: -        pnt[i] = 0 -print((sum(ac.values()), sum(pnt.values()))) +    if s == "AC": +        if acs[p] == 0: +            ac += 1 +            wa += was[p] +            acs[p] = 1 +    else: +        was[p] += 1 +print((ac, wa))