import numpy as np



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

AC_or_not = np.array([0] * N)

n_penalty = np.array([0] * N)



for _ in range(M):

    prob, wa_ac = input().split()

    prob = int(prob) - 1

    if wa_ac == 'AC':

        AC_or_not[prob] = 1

    else:

        if not AC_or_not[prob]:

            n_penalty[prob] += 1



print((sum(AC_or_not), sum(n_penalty * AC_or_not)))
N, M = list(map(int, input().split()))

AC_or_not = [False] * N

n_penalty = [0] * N

cnt_ac = 0

cnt_pen = 0



for _ in range(M):

    prob, wa_ac = input().split()

    prob = int(prob) - 1

    if wa_ac == 'AC':

        if not AC_or_not[prob]:

            cnt_pen += n_penalty[prob]

            cnt_ac += 1

            AC_or_not[prob] = True

    else:

            n_penalty[prob] += 1



print((cnt_ac ,cnt_pen))
import numpy as np

N, M = list(map(int, input().split()))
AC_or_not = np.array([0] * N)
n_penalty = np.array([0] * N)
for _ in range(M):
    prob, wa_ac = input().split()
    prob = int(prob) - 1
    if wa_ac == "AC":
        AC_or_not[prob] = 1
    else:
        if not AC_or_not[prob]:
            n_penalty[prob] += 1
print((sum(AC_or_not), sum(n_penalty * AC_or_not)))

N, M = list(map(int, input().split()))
AC_or_not = [False] * N
n_penalty = [0] * N
cnt_ac = 0
cnt_pen = 0
for _ in range(M):
    prob, wa_ac = input().split()
    prob = int(prob) - 1
    if wa_ac == "AC":
        if not AC_or_not[prob]:
            cnt_pen += n_penalty[prob]
            cnt_ac += 1
            AC_or_not[prob] = True
    else:
        n_penalty[prob] += 1
print((cnt_ac, cnt_pen))

-import numpy as np - -AC_or_not = np.array([0] * N) -n_penalty = np.array([0] * N) +AC_or_not = [False] * N +n_penalty = [0] * N +cnt_ac = 0 +cnt_pen = 0 -        AC_or_not[prob] = 1 +        if not AC_or_not[prob]: +            cnt_pen += n_penalty[prob] +            cnt_ac += 1 +            AC_or_not[prob] = True -        if not AC_or_not[prob]: -            n_penalty[prob] += 1 -print((sum(AC_or_not), sum(n_penalty * AC_or_not))) +        n_penalty[prob] += 1 +print((cnt_ac, cnt_pen))