import numpy as np

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

ac = np.zeros(n)

wa = np.zeros(n)

for _ in range(m):

    p, s = input().split()

    p = int(p) - 1

    if s == "AC":

        ac[p] = 1

    elif not ac[p]:

        wa[p] += 1

print(("{} {}".format(np.sum(ac, dtype=np.int64), np.sum(ac * wa, dtype=np.int64))))
n, m = list(map(int, input().split()))

ac = [0] * n

wa = [0] * n

for _ in range(m):

    p, s = input().split()

    p = int(p) - 1

    if s == "AC":

        ac[p] = 1

    elif not ac[p]:

        wa[p] += 1

ans = [sum(ac), sum([i * j for i, j in zip(ac, wa)])]

print(("{} {}".format(ans[0], ans[1])))
import numpy as np

n, m = list(map(int, input().split()))
ac = np.zeros(n)
wa = np.zeros(n)
for _ in range(m):
    p, s = input().split()
    p = int(p) - 1
    if s == "AC":
        ac[p] = 1
    elif not ac[p]:
        wa[p] += 1
print(("{} {}".format(np.sum(ac, dtype=np.int64), np.sum(ac * wa, dtype=np.int64))))

n, m = list(map(int, input().split()))
ac = [0] * n
wa = [0] * n
for _ in range(m):
    p, s = input().split()
    p = int(p) - 1
    if s == "AC":
        ac[p] = 1
    elif not ac[p]:
        wa[p] += 1
ans = [sum(ac), sum([i * j for i, j in zip(ac, wa)])]
print(("{} {}".format(ans[0], ans[1])))

-import numpy as np - -ac = np.zeros(n) -wa = np.zeros(n) +ac = [0] * n +wa = [0] * n -print(("{} {}".format(np.sum(ac, dtype=np.int64), np.sum(ac * wa, dtype=np.int64)))) +ans = [sum(ac), sum([i * j for i, j in zip(ac, wa)])] +print(("{} {}".format(ans[0], ans[1])))