n, m = list(map(int, input().split()))

ac_lst = [False] * (n + 1)

wa_lst = [0] * (n + 1)

w = 0

for _ in range(m):

    a, b = input().split()

    a = int(a)

    if ac_lst[a]:

        continue

    if b == 'WA':

        wa_lst[a] += 1

    else:

        w += wa_lst[a]

        ac_lst[a] = True

print((sum(ac_lst), w))

import sys

readline = sys.stdin.buffer.readline



n, m = list(map(int, readline().split()))

ac_lst = [False] * (n + 1)

wa_lst = [0] * (n + 1)

w = 0

for _ in range(m):

    a, b = readline().split()

    a = int(a)

    if ac_lst[a]:

        continue

    if b == b'WA':

        wa_lst[a] += 1

    else:

        w += wa_lst[a]

        ac_lst[a] = True

print((sum(ac_lst), w))

n, m = list(map(int, input().split()))
ac_lst = [False] * (n + 1)
wa_lst = [0] * (n + 1)
w = 0
for _ in range(m):
    a, b = input().split()
    a = int(a)
    if ac_lst[a]:
        continue
    if b == "WA":
        wa_lst[a] += 1
    else:
        w += wa_lst[a]
        ac_lst[a] = True
print((sum(ac_lst), w))

import sys

readline = sys.stdin.buffer.readline
n, m = list(map(int, readline().split()))
ac_lst = [False] * (n + 1)
wa_lst = [0] * (n + 1)
w = 0
for _ in range(m):
    a, b = readline().split()
    a = int(a)
    if ac_lst[a]:
        continue
    if b == b"WA":
        wa_lst[a] += 1
    else:
        w += wa_lst[a]
        ac_lst[a] = True
print((sum(ac_lst), w))

-n, m = list(map(int, input().split())) +import sys + +readline = sys.stdin.buffer.readline +n, m = list(map(int, readline().split())) -    a, b = input().split() +    a, b = readline().split() -    if b == "WA": +    if b == b"WA":