from collections import defaultdict



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

P=[]

S=[]

for i in range (M):

	A,B=input().split()

	P.append(int(A))

	S.append(B)

Q=defaultdict(lambda:0)

R=defaultdict(lambda:0)

count=0

for i,j in zip(P,S):

  if Q[i]==0:

    if j=="AC":

      Q[i]=1

      count+=R[i]

    elif j=="WA":

      R[i]+=1

print((sum(Q.values()),count))
N,M=list(map(int,input().split()))

L=[0]*N

A=0

W=0

tmp=[0]*N

for i in range(M):

	x,y=input().split()

	t=int(x)

	if L[t-1]==0:

		if y=="WA":

			tmp[t-1]+=1

		else:

			A+=1

			W+=tmp[t-1]

			L[t-1]=1

print((A,W))
from collections import defaultdict

N, M = list(map(int, input().split()))
P = []
S = []
for i in range(M):
    A, B = input().split()
    P.append(int(A))
    S.append(B)
Q = defaultdict(lambda: 0)
R = defaultdict(lambda: 0)
count = 0
for i, j in zip(P, S):
    if Q[i] == 0:
        if j == "AC":
            Q[i] = 1
            count += R[i]
        elif j == "WA":
            R[i] += 1
print((sum(Q.values()), count))

N, M = list(map(int, input().split()))
L = [0] * N
A = 0
W = 0
tmp = [0] * N
for i in range(M):
    x, y = input().split()
    t = int(x)
    if L[t - 1] == 0:
        if y == "WA":
            tmp[t - 1] += 1
        else:
            A += 1
            W += tmp[t - 1]
            L[t - 1] = 1
print((A, W))

-from collections import defaultdict - -P = [] -S = [] +L = [0] * N +A = 0 +W = 0 +tmp = [0] * N -    A, B = input().split() -    P.append(int(A)) -    S.append(B) -Q = defaultdict(lambda: 0) -R = defaultdict(lambda: 0) -count = 0 -for i, j in zip(P, S): -    if Q[i] == 0: -        if j == "AC": -            Q[i] = 1 -            count += R[i] -        elif j == "WA": -            R[i] += 1 -print((sum(Q.values()), count)) +    x, y = input().split() +    t = int(x) +    if L[t - 1] == 0: +        if y == "WA": +            tmp[t - 1] += 1 +        else: +            A += 1 +            W += tmp[t - 1] +            L[t - 1] = 1 +print((A, W))