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

ps = [input().split() for _ in range(m)]

ac = [0]*n

pe = [0]*n

for p, s in ps:

  k = int(p) - 1

  if s == "AC":

    ac[k] = 1

  else:

    if ac[k]:

      continue

    else:

      pe[k] += 1

v, w = 0, 0

for i in range(n):

  if ac[i]:

    v += 1

    w += pe[i]

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

cnt = 0

pena = 0

L = [-1]*(n+1)

C = [0]*(n+1)

for _ in range(m):

  p, s = input().split()

  p = int(p)

  if s == "WA":

    if L[p] == -1:

      C[p] += 1

  else:

    if L[p] == -1:

      L[p] = 1

      cnt += 1

      pena += C[p]

print((cnt, pena))
n, m = list(map(int, input().split()))
ps = [input().split() for _ in range(m)]
ac = [0] * n
pe = [0] * n
for p, s in ps:
    k = int(p) - 1
    if s == "AC":
        ac[k] = 1
    else:
        if ac[k]:
            continue
        else:
            pe[k] += 1
v, w = 0, 0
for i in range(n):
    if ac[i]:
        v += 1
        w += pe[i]
print((v, w))

n, m = list(map(int, input().split()))
cnt = 0
pena = 0
L = [-1] * (n + 1)
C = [0] * (n + 1)
for _ in range(m):
    p, s = input().split()
    p = int(p)
    if s == "WA":
        if L[p] == -1:
            C[p] += 1
    else:
        if L[p] == -1:
            L[p] = 1
            cnt += 1
            pena += C[p]
print((cnt, pena))

-ps = [input().split() for _ in range(m)] -ac = [0] * n -pe = [0] * n -for p, s in ps: -    k = int(p) - 1 -    if s == "AC": -        ac[k] = 1 +cnt = 0 +pena = 0 +L = [-1] * (n + 1) +C = [0] * (n + 1) +for _ in range(m): +    p, s = input().split() +    p = int(p) +    if s == "WA": +        if L[p] == -1: +            C[p] += 1 -        if ac[k]: -            continue -        else: -            pe[k] += 1 -v, w = 0, 0 -for i in range(n): -    if ac[i]: -        v += 1 -        w += pe[i] -print((v, w)) +        if L[p] == -1: +            L[p] = 1 +            cnt += 1 +            pena += C[p] +print((cnt, pena))