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)))
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 if a > 0 else 0 for a, w in zip(ac, wa)])

print(("{} {}".format(sum(ac), penalties)))
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)))

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 if a > 0 else 0 for a, w in zip(ac, wa)])
print(("{} {}".format(sum(ac), penalties)))

-penalties = sum([w * a for a, w in zip(ac, wa)]) +penalties = sum([w if a > 0 else 0 for a, w in zip(ac, wa)])