import sys

#import numpy as np



stdin = sys.stdin



ri = lambda: int(rs())

rl = lambda: list(map(int, stdin.readline().split())) # applies to numbers only

rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces



N, M = rl()

solve = [False] * (N+1)

count = [0] * (N+1)

penalty = 0

for i in range(M):

    p, s = input().split()

    p = int(p)

    if solve[p]:

        continue

    if s == 'WA':

        count[p] += 1

    else:

        solve[p] = True

        penalty += count[p]



print((sum(solve), penalty))

import sys



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



N, M = lr()

problems = [False] * N

AC = [0] * N

WA = [0] * N

for _ in range(M):

    p, S = sr().split(); p = int(p) - 1

    if not problems[p] and S == 'WA':

        WA[p] += 1

    if not problems[p] and S == 'AC':

        problems[p] = True

        AC[p] += 1



AC_total = sum(AC)

WA_total = sum(y for x, y in zip(AC, WA) if x)

print((AC_total, WA_total))

import sys

# import numpy as np
stdin = sys.stdin
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))  # applies to numbers only
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces
N, M = rl()
solve = [False] * (N + 1)
count = [0] * (N + 1)
penalty = 0
for i in range(M):
    p, s = input().split()
    p = int(p)
    if solve[p]:
        continue
    if s == "WA":
        count[p] += 1
    else:
        solve[p] = True
        penalty += count[p]
print((sum(solve), penalty))

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N, M = lr()
problems = [False] * N
AC = [0] * N
WA = [0] * N
for _ in range(M):
    p, S = sr().split()
    p = int(p) - 1
    if not problems[p] and S == "WA":
        WA[p] += 1
    if not problems[p] and S == "AC":
        problems[p] = True
        AC[p] += 1
AC_total = sum(AC)
WA_total = sum(y for x, y in zip(AC, WA) if x)
print((AC_total, WA_total))

-# import numpy as np -stdin = sys.stdin -ri = lambda: int(rs()) -rl = lambda: list(map(int, stdin.readline().split()))  # applies to numbers only -rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces -N, M = rl() -solve = [False] * (N + 1) -count = [0] * (N + 1) -penalty = 0 -for i in range(M): -    p, s = input().split() -    p = int(p) -    if solve[p]: -        continue -    if s == "WA": -        count[p] += 1 -    else: -        solve[p] = True -        penalty += count[p] -print((sum(solve), penalty)) +sr = lambda: sys.stdin.readline().rstrip() +ir = lambda: int(sr()) +lr = lambda: list(map(int, sr().split())) +N, M = lr() +problems = [False] * N +AC = [0] * N +WA = [0] * N +for _ in range(M): +    p, S = sr().split() +    p = int(p) - 1 +    if not problems[p] and S == "WA": +        WA[p] += 1 +    if not problems[p] and S == "AC": +        problems[p] = True +        AC[p] += 1 +AC_total = sum(AC) +WA_total = sum(y for x, y in zip(AC, WA) if x) +print((AC_total, WA_total))