import numpy as np

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

d = np.zeros(N+1, dtype = 'int32')

t = 0

f = 0

for i in range(M):

    tmp = input().split()

    p = int(tmp[0])

    S = tmp[1]

    dp = d[p]

    if S == 'AC':

        if dp != -1:

            f += dp

            d[p] = -1

            t += 1

    elif dp != -1:

        d[p] += 1

print((t, f))

import numpy as np

import sys

input = sys.stdin.readline

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

d = np.zeros(N+1, dtype = 'int32')

t = 0

f = 0



for i in range(M):

    tmp = input().split()

    p = int(tmp[0])

    S = tmp[1]

    dp = d[p]

    if S == 'AC':

        if dp != -1:

            f += dp

            d[p] = -1

            t += 1

    elif dp != -1:

        d[p] += 1

print((t, f))

import numpy as np

N, M = list(map(int, input().split()))
d = np.zeros(N + 1, dtype="int32")
t = 0
f = 0
for i in range(M):
    tmp = input().split()
    p = int(tmp[0])
    S = tmp[1]
    dp = d[p]
    if S == "AC":
        if dp != -1:
            f += dp
            d[p] = -1
            t += 1
    elif dp != -1:
        d[p] += 1
print((t, f))

import numpy as np
import sys

input = sys.stdin.readline
N, M = list(map(int, input().split()))
d = np.zeros(N + 1, dtype="int32")
t = 0
f = 0
for i in range(M):
    tmp = input().split()
    p = int(tmp[0])
    S = tmp[1]
    dp = d[p]
    if S == "AC":
        if dp != -1:
            f += dp
            d[p] = -1
            t += 1
    elif dp != -1:
        d[p] += 1
print((t, f))

+import sys +input = sys.stdin.readline