from sys import stdin

input = stdin.readline

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

ac = [False] * N

wa = [0] * N

wa_cnt = 0

for i in range(M):

  p, s = input().split()

  p = int(p) - 1

  if ac[p] is False and s == "AC":

    wa_cnt += wa[p]

    ac[p] = True

  elif s == "WA":

    wa[p] += 1

print((ac.count(True), wa_cnt))
import sys

N, M, *PS = sys.stdin.read().strip().split()

N = int(N)

ac = [0] * N

wa = [0] * N

for p, s in zip(*[iter(PS)] * 2):

  p = int(p) - 1

  if s == "AC":

    ac[p] = 1

  elif ac[p] == 0:

    wa[p] += 1

penalties = sum([w * a for a, w in zip(ac, wa)])

print(("{} {}".format(sum(ac), penalties)))
from sys import stdin

input = stdin.readline
N, M = list(map(int, input().split()))
ac = [False] * N
wa = [0] * N
wa_cnt = 0
for i in range(M):
    p, s = input().split()
    p = int(p) - 1
    if ac[p] is False and s == "AC":
        wa_cnt += wa[p]
        ac[p] = True
    elif s == "WA":
        wa[p] += 1
print((ac.count(True), wa_cnt))

import sys

N, M, *PS = sys.stdin.read().strip().split()
N = int(N)
ac = [0] * N
wa = [0] * N
for p, s in zip(*[iter(PS)] * 2):
    p = int(p) - 1
    if s == "AC":
        ac[p] = 1
    elif ac[p] == 0:
        wa[p] += 1
penalties = sum([w * a for a, w in zip(ac, wa)])
print(("{} {}".format(sum(ac), penalties)))

-from sys import stdin +import sys -input = stdin.readline -N, M = list(map(int, input().split())) -ac = [False] * N +N, M, *PS = sys.stdin.read().strip().split() +N = int(N) +ac = [0] * N -wa_cnt = 0 -for i in range(M): -    p, s = input().split() +for p, s in zip(*[iter(PS)] * 2): -    if ac[p] is False and s == "AC": -        wa_cnt += wa[p] -        ac[p] = True -    elif s == "WA": +    if s == "AC": +        ac[p] = 1 +    elif ac[p] == 0: -print((ac.count(True), wa_cnt)) +penalties = sum([w * a for a, w in zip(ac, wa)]) +print(("{} {}".format(sum(ac), penalties)))