import sys

nm=input().rstrip().split(" ")

n=int(nm[0])

m=int(nm[1])

answers=[[] for i in range(n)]

for i in range(m):

    line=input().rstrip().split(" ")

    if line[1]=="AC":

        answers[int(line[0])-1].append(1)

    if line[1]=="WA":

        answers[int(line[0])-1].append(0)

#print(answers)

ac=0

i=0

was=[]

while i<n:

    sums=0

    j=0

    while j<len(answers[i]):

        sums=sums+answers[i][j]

        if sums>0:

            ac+=1

            was.append(j)

            break

        j=j+1

    i=i+1

print(ac,end=" ")

#print(was)

wacount=0

for j in was:

    wacount=wacount+j

print(wacount)  

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

L=[list(input().split()) for i in range(M)]

W=[0]*N

A=[0]*N

a=0

w=0

for i in range(M):

  if L[i][1]=="AC":

    A[int(L[i][0])-1]=1

    

  elif L[i][1]=="WA" and A[int(L[i][0])-1]==0:

    W[int(L[i][0])-1]+=1

#for i in A:

  #a+=i

#for i in W:

  #w+=i

for i in range(N):

  if A[i]>0:

    a+=1

    w+=W[i]

print((a,w))



import sys

nm = input().rstrip().split(" ")
n = int(nm[0])
m = int(nm[1])
answers = [[] for i in range(n)]
for i in range(m):
    line = input().rstrip().split(" ")
    if line[1] == "AC":
        answers[int(line[0]) - 1].append(1)
    if line[1] == "WA":
        answers[int(line[0]) - 1].append(0)
# print(answers)
ac = 0
i = 0
was = []
while i < n:
    sums = 0
    j = 0
    while j < len(answers[i]):
        sums = sums + answers[i][j]
        if sums > 0:
            ac += 1
            was.append(j)
            break
        j = j + 1
    i = i + 1
print(ac, end=" ")
# print(was)
wacount = 0
for j in was:
    wacount = wacount + j
print(wacount)

N, M = list(map(int, input().split()))
L = [list(input().split()) for i in range(M)]
W = [0] * N
A = [0] * N
a = 0
w = 0
for i in range(M):
    if L[i][1] == "AC":
        A[int(L[i][0]) - 1] = 1
    elif L[i][1] == "WA" and A[int(L[i][0]) - 1] == 0:
        W[int(L[i][0]) - 1] += 1
# for i in A:
# a+=i
# for i in W:
# w+=i
for i in range(N):
    if A[i] > 0:
        a += 1
        w += W[i]
print((a, w))

-import sys - -nm = input().rstrip().split(" ") -n = int(nm[0]) -m = int(nm[1]) -answers = [[] for i in range(n)] -for i in range(m): -    line = input().rstrip().split(" ") -    if line[1] == "AC": -        answers[int(line[0]) - 1].append(1) -    if line[1] == "WA": -        answers[int(line[0]) - 1].append(0) -# print(answers) -ac = 0 -i = 0 -was = [] -while i < n: -    sums = 0 -    j = 0 -    while j < len(answers[i]): -        sums = sums + answers[i][j] -        if sums > 0: -            ac += 1 -            was.append(j) -            break -        j = j + 1 -    i = i + 1 -print(ac, end=" ") -# print(was) -wacount = 0 -for j in was: -    wacount = wacount + j -print(wacount) +N, M = list(map(int, input().split())) +L = [list(input().split()) for i in range(M)] +W = [0] * N +A = [0] * N +a = 0 +w = 0 +for i in range(M): +    if L[i][1] == "AC": +        A[int(L[i][0]) - 1] = 1 +    elif L[i][1] == "WA" and A[int(L[i][0]) - 1] == 0: +        W[int(L[i][0]) - 1] += 1 +# for i in A: +# a+=i +# for i in W: +# w+=i +for i in range(N): +    if A[i] > 0: +        a += 1 +        w += W[i] +print((a, w))