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

import numpy as np



pena=np.array([0]*N)

status=np.array([0]*N)





for i in range(M):

  p,s=tuple(input().split())

  p=int(p)

  if s=="WA":

    if status[p-1]!=1:

      pena[p-1]+=1

  if s=="AC":

    if status[p-1]!=1:

      status[p-1]=1

nac=sum(status)

npena=sum(pena*status)

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

now=[0]*N

pena=0

for i in range(M):

    num,result=input().split()

    num=int(num)-1

    if result=="AC":

        if now[num]>0:

            pena+=now[num]

        now[num]=-1

    else:

        if now[num]>=0:

            now[num]+=1

print((now.count(-1), pena))

N, M = list(map(int, input().split()))
import numpy as np

pena = np.array([0] * N)
status = np.array([0] * N)
for i in range(M):
    p, s = tuple(input().split())
    p = int(p)
    if s == "WA":
        if status[p - 1] != 1:
            pena[p - 1] += 1
    if s == "AC":
        if status[p - 1] != 1:
            status[p - 1] = 1
nac = sum(status)
npena = sum(pena * status)
print((nac, npena))

N, M = list(map(int, input().split()))
now = [0] * N
pena = 0
for i in range(M):
    num, result = input().split()
    num = int(num) - 1
    if result == "AC":
        if now[num] > 0:
            pena += now[num]
        now[num] = -1
    else:
        if now[num] >= 0:
            now[num] += 1
print((now.count(-1), pena))

-import numpy as np - -pena = np.array([0] * N) -status = np.array([0] * N) +now = [0] * N +pena = 0 -    p, s = tuple(input().split()) -    p = int(p) -    if s == "WA": -        if status[p - 1] != 1: -            pena[p - 1] += 1 -    if s == "AC": -        if status[p - 1] != 1: -            status[p - 1] = 1 -nac = sum(status) -npena = sum(pena * status) -print((nac, npena)) +    num, result = input().split() +    num = int(num) - 1 +    if result == "AC": +        if now[num] > 0: +            pena += now[num] +        now[num] = -1 +    else: +        if now[num] >= 0: +            now[num] += 1 +print((now.count(-1), pena))