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

A=0

PE=0

PRO=[[] for i in range(N)]

for i in range(M):

  P,S=input().split()

  P=int(P)-1

  PRO[P].append(S)

#print(PRO)

for i in range(N):

  tmp=0

  for j in range(len(PRO[i])):

    flag=False

    if PRO[i][j]=='AC':

      A+=1

      flag=True

    if PRO[i][j]=='WA':

      tmp+=1

    if flag:

      PE+=tmp

      break

print((A,PE))
def II(): return int(eval(input()))

def MI(): return list(map(int, input().split()))

def LI(): return list(map(int, input().split()))

ans,pena=0,0

N,M=MI()

P=[0]*N

PENA=[0]*N

for i in range(M):

  p,s=input().split()

  p=int(p)

  p-=1

  if s=='AC':

    if P[p]==0:

      ans+=1

      P[p]=1

      if PENA[p]!=0:

        pena+=PENA[p]

  if s=='WA':

    if P[p]==0:

      PENA[p]+=1

print((ans,pena))

N, M = list(map(int, input().split()))
A = 0
PE = 0
PRO = [[] for i in range(N)]
for i in range(M):
    P, S = input().split()
    P = int(P) - 1
    PRO[P].append(S)
# print(PRO)
for i in range(N):
    tmp = 0
    for j in range(len(PRO[i])):
        flag = False
        if PRO[i][j] == "AC":
            A += 1
            flag = True
        if PRO[i][j] == "WA":
            tmp += 1
        if flag:
            PE += tmp
            break
print((A, PE))

def II():
    return int(eval(input()))


def MI():
    return list(map(int, input().split()))


def LI():
    return list(map(int, input().split()))


ans, pena = 0, 0
N, M = MI()
P = [0] * N
PENA = [0] * N
for i in range(M):
    p, s = input().split()
    p = int(p)
    p -= 1
    if s == "AC":
        if P[p] == 0:
            ans += 1
            P[p] = 1
            if PENA[p] != 0:
                pena += PENA[p]
    if s == "WA":
        if P[p] == 0:
            PENA[p] += 1
print((ans, pena))

-N, M = list(map(int, input().split())) -A = 0 -PE = 0 -PRO = [[] for i in range(N)] +def II(): +    return int(eval(input())) + + +def MI(): +    return list(map(int, input().split())) + + +def LI(): +    return list(map(int, input().split())) + + +ans, pena = 0, 0 +N, M = MI() +P = [0] * N +PENA = [0] * N -    P, S = input().split() -    P = int(P) - 1 -    PRO[P].append(S) -# print(PRO) -for i in range(N): -    tmp = 0 -    for j in range(len(PRO[i])): -        flag = False -        if PRO[i][j] == "AC": -            A += 1 -            flag = True -        if PRO[i][j] == "WA": -            tmp += 1 -        if flag: -            PE += tmp -            break -print((A, PE)) +    p, s = input().split() +    p = int(p) +    p -= 1 +    if s == "AC": +        if P[p] == 0: +            ans += 1 +            P[p] = 1 +            if PENA[p] != 0: +                pena += PENA[p] +    if s == "WA": +        if P[p] == 0: +            PENA[p] += 1 +print((ans, pena))