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



ac = 0

wa = 0

res1 = [0]*n

res2 = [0]*n

for i in range(m):

  p, s = list(map(str, input().split()))

  if s == 'AC' and res1[int(p)-1] == 0:

    ac += 1

    res1[int(p)-1] = 1

    wa += res2[int(p)-1]

  elif s == 'WA' and res1[int(p)-1] == 0:

    res2[int(p)-1] += 1

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

ac=[0]*(n+1)

wa=0

for i in range(m):

  p,c=input().split()

  if c=='WA' and ac[int(p)]!=1:

    ac[int(p)]-=1

  elif c=='AC' and ac[int(p)]!=1:

    wa+=abs(ac[int(p)])

    ac[int(p)]=1

print((ac.count(1),wa))
n, m = list(map(int, input().split()))
ac = 0
wa = 0
res1 = [0] * n
res2 = [0] * n
for i in range(m):
    p, s = list(map(str, input().split()))
    if s == "AC" and res1[int(p) - 1] == 0:
        ac += 1
        res1[int(p) - 1] = 1
        wa += res2[int(p) - 1]
    elif s == "WA" and res1[int(p) - 1] == 0:
        res2[int(p) - 1] += 1
print((ac, wa))

n, m = list(map(int, input().split()))
ac = [0] * (n + 1)
wa = 0
for i in range(m):
    p, c = input().split()
    if c == "WA" and ac[int(p)] != 1:
        ac[int(p)] -= 1
    elif c == "AC" and ac[int(p)] != 1:
        wa += abs(ac[int(p)])
        ac[int(p)] = 1
print((ac.count(1), wa))

-ac = 0 +ac = [0] * (n + 1) -res1 = [0] * n -res2 = [0] * n -    p, s = list(map(str, input().split())) -    if s == "AC" and res1[int(p) - 1] == 0: -        ac += 1 -        res1[int(p) - 1] = 1 -        wa += res2[int(p) - 1] -    elif s == "WA" and res1[int(p) - 1] == 0: -        res2[int(p) - 1] += 1 -print((ac, wa)) +    p, c = input().split() +    if c == "WA" and ac[int(p)] != 1: +        ac[int(p)] -= 1 +    elif c == "AC" and ac[int(p)] != 1: +        wa += abs(ac[int(p)]) +        ac[int(p)] = 1 +print((ac.count(1), wa))