import math

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

judge = [0]*N

ac = 0

wa = 0

for i in range(M):

  p, S = input().split()

  if judge[int(p)-1] == 'AC':

    pass

  elif S == 'AC':

    wa += judge[int(p)-1]

    judge[int(p)-1] = 'AC'

    ac += 1

  else:

    judge[int(p)-1] += 1

print((ac,wa))
def solve():

  ans = [0,0]

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

  WAs = [0]*N

  for i in range(M):

    p, S = input().split()

    p = int(p)

    if WAs[p-1]>=0:

      if S=='WA':

        WAs[p-1] += 1

      if S=='AC':

        ans[0] += 1

        ans[1] += WAs[p-1]

        WAs[p-1] = -1

  return ans

print((*solve()))
import math

N, M = list(map(int, input().split()))
judge = [0] * N
ac = 0
wa = 0
for i in range(M):
    p, S = input().split()
    if judge[int(p) - 1] == "AC":
        pass
    elif S == "AC":
        wa += judge[int(p) - 1]
        judge[int(p) - 1] = "AC"
        ac += 1
    else:
        judge[int(p) - 1] += 1
print((ac, wa))

def solve():
    ans = [0, 0]
    N, M = list(map(int, input().split()))
    WAs = [0] * N
    for i in range(M):
        p, S = input().split()
        p = int(p)
        if WAs[p - 1] >= 0:
            if S == "WA":
                WAs[p - 1] += 1
            if S == "AC":
                ans[0] += 1
                ans[1] += WAs[p - 1]
                WAs[p - 1] = -1
    return ans


print((*solve()))

-import math +def solve(): +    ans = [0, 0] +    N, M = list(map(int, input().split())) +    WAs = [0] * N +    for i in range(M): +        p, S = input().split() +        p = int(p) +        if WAs[p - 1] >= 0: +            if S == "WA": +                WAs[p - 1] += 1 +            if S == "AC": +                ans[0] += 1 +                ans[1] += WAs[p - 1] +                WAs[p - 1] = -1 +    return ans -N, M = list(map(int, input().split())) -judge = [0] * N -ac = 0 -wa = 0 -for i in range(M): -    p, S = input().split() -    if judge[int(p) - 1] == "AC": -        pass -    elif S == "AC": -        wa += judge[int(p) - 1] -        judge[int(p) - 1] = "AC" -        ac += 1 -    else: -        judge[int(p) - 1] += 1 -print((ac, wa)) + +print((*solve()))