# coding: utf-8

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

ac, wa = 0, 0

l = {}

T = {}

idx, sta = -1, -1

for i in range(M):

    tmp = input().split()

    p = int(tmp[0])

    s = tmp[1]

    if p not in list(l.keys()):

        l[p] = 0

        T[p] = False

    if s == "AC" and not T[p]:

        ac += 1

        T[p] = True

    if s == "WA" and not T[p]:

        wa += 1

        l[p] += 1

cnt = 0

for k in list(l.keys()):

    if not T[k]:

        cnt += l[k]

print((ac, wa-cnt))
# coding: utf-8

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

AC, WA = [], []

AC = [False for _ in range(10**5)]

WA = [0 for _ in range(10**5)]

ac, wa = 0, 0

for i in range(M):

    tmp = input().split()

    p = int(tmp[0]) - 1

    s = tmp[1]

    if AC[p]:

        continue

    else:

        if s == "AC":

            AC[p] = True

        else:

            WA[p] += 1

for i in range(N):

    if AC[i]:

        ac += 1

        wa += WA[i]

print((ac, wa))
# coding: utf-8
N, M = list(map(int, input().split()))
ac, wa = 0, 0
l = {}
T = {}
idx, sta = -1, -1
for i in range(M):
    tmp = input().split()
    p = int(tmp[0])
    s = tmp[1]
    if p not in list(l.keys()):
        l[p] = 0
        T[p] = False
    if s == "AC" and not T[p]:
        ac += 1
        T[p] = True
    if s == "WA" and not T[p]:
        wa += 1
        l[p] += 1
cnt = 0
for k in list(l.keys()):
    if not T[k]:
        cnt += l[k]
print((ac, wa - cnt))

# coding: utf-8
N, M = list(map(int, input().split()))
AC, WA = [], []
AC = [False for _ in range(10**5)]
WA = [0 for _ in range(10**5)]
ac, wa = 0, 0
for i in range(M):
    tmp = input().split()
    p = int(tmp[0]) - 1
    s = tmp[1]
    if AC[p]:
        continue
    else:
        if s == "AC":
            AC[p] = True
        else:
            WA[p] += 1
for i in range(N):
    if AC[i]:
        ac += 1
        wa += WA[i]
print((ac, wa))

+AC, WA = [], [] +AC = [False for _ in range(10**5)] +WA = [0 for _ in range(10**5)] -l = {} -T = {} -idx, sta = -1, -1 -    p = int(tmp[0]) +    p = int(tmp[0]) - 1 -    if p not in list(l.keys()): -        l[p] = 0 -        T[p] = False -    if s == "AC" and not T[p]: +    if AC[p]: +        continue +    else: +        if s == "AC": +            AC[p] = True +        else: +            WA[p] += 1 +for i in range(N): +    if AC[i]: -        T[p] = True -    if s == "WA" and not T[p]: -        wa += 1 -        l[p] += 1 -cnt = 0 -for k in list(l.keys()): -    if not T[k]: -        cnt += l[k] -print((ac, wa - cnt)) +        wa += WA[i] +print((ac, wa))