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

ac = [False] * N

wa = [0] * N

for _ in range(M):

    p, s = input().split()

    p = int(p) - 1

    if not ac[p]:

        if s == "AC":

            ac[p] = True

        else:

            wa[p] += 1

accnt = len([1 for x in ac if x])

wacnt = sum([wa[i] for i in range(N) if ac[i]])

print((accnt, wacnt))
import sys

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

ac = [0] * N

wa = [0] * N



for _ in range(M):

    p, s = sys.stdin.readline().split()

    p = int(p) - 1

    if s == "AC":

        ac[p] = 1

    else:

        if not ac[p]:

            wa[p] += 1

acnum = sum(ac)

wanum = sum([c for i, c in enumerate(wa) if ac[i] == 1])

print((acnum, wanum))
N, M = list(map(int, input().split()))
ac = [False] * N
wa = [0] * N
for _ in range(M):
    p, s = input().split()
    p = int(p) - 1
    if not ac[p]:
        if s == "AC":
            ac[p] = True
        else:
            wa[p] += 1
accnt = len([1 for x in ac if x])
wacnt = sum([wa[i] for i in range(N) if ac[i]])
print((accnt, wacnt))

import sys

N, M = list(map(int, input().split()))
ac = [0] * N
wa = [0] * N
for _ in range(M):
    p, s = sys.stdin.readline().split()
    p = int(p) - 1
    if s == "AC":
        ac[p] = 1
    else:
        if not ac[p]:
            wa[p] += 1
acnum = sum(ac)
wanum = sum([c for i, c in enumerate(wa) if ac[i] == 1])
print((acnum, wanum))

+import sys + -ac = [False] * N +ac = [0] * N -    p, s = input().split() +    p, s = sys.stdin.readline().split() -    if not ac[p]: -        if s == "AC": -            ac[p] = True -        else: +    if s == "AC": +        ac[p] = 1 +    else: +        if not ac[p]: -accnt = len([1 for x in ac if x]) -wacnt = sum([wa[i] for i in range(N) if ac[i]]) -print((accnt, wacnt)) +acnum = sum(ac) +wanum = sum([c for i, c in enumerate(wa) if ac[i] == 1]) +print((acnum, wanum))