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

la = []

lw = []

lwa = []

for i in range(n):

  la.append(0)

  lw.append(0)

  lwa.append(0)

for _ in range(m):

  q,a = input().split()

  if a == "WA" and la[int(q)-1] != 1:

    lw[int(q)-1] += 1

  elif a == "AC" and la[int(q)-1] != 1:

    la[int(q)-1] = 1

    lwa[int(q)-1] = lw[int(q)-1]

    

print((sum(la), sum(lwa)))
n,m = list(map(int, input().split()))

a = []

for _ in range(n):

  a.append(0)

w = a.copy()

x = a.copy()

for _ in range(m):

  q,r = input().split()

  q = int(q)-1

  if r == "WA" and a[q] != 1:

    w[q] += 1

  elif r == "AC" and a[q] != 1:

    x[q] = w[q]

    a[q] = 1

print((sum(a), sum(x)))
n, m = list(map(int, input().split()))
la = []
lw = []
lwa = []
for i in range(n):
    la.append(0)
    lw.append(0)
    lwa.append(0)
for _ in range(m):
    q, a = input().split()
    if a == "WA" and la[int(q) - 1] != 1:
        lw[int(q) - 1] += 1
    elif a == "AC" and la[int(q) - 1] != 1:
        la[int(q) - 1] = 1
        lwa[int(q) - 1] = lw[int(q) - 1]
print((sum(la), sum(lwa)))

n, m = list(map(int, input().split()))
a = []
for _ in range(n):
    a.append(0)
w = a.copy()
x = a.copy()
for _ in range(m):
    q, r = input().split()
    q = int(q) - 1
    if r == "WA" and a[q] != 1:
        w[q] += 1
    elif r == "AC" and a[q] != 1:
        x[q] = w[q]
        a[q] = 1
print((sum(a), sum(x)))

-la = [] -lw = [] -lwa = [] -for i in range(n): -    la.append(0) -    lw.append(0) -    lwa.append(0) +a = [] +for _ in range(n): +    a.append(0) +w = a.copy() +x = a.copy() -    q, a = input().split() -    if a == "WA" and la[int(q) - 1] != 1: -        lw[int(q) - 1] += 1 -    elif a == "AC" and la[int(q) - 1] != 1: -        la[int(q) - 1] = 1 -        lwa[int(q) - 1] = lw[int(q) - 1] -print((sum(la), sum(lwa))) +    q, r = input().split() +    q = int(q) - 1 +    if r == "WA" and a[q] != 1: +        w[q] += 1 +    elif r == "AC" and a[q] != 1: +        x[q] = w[q] +        a[q] = 1 +print((sum(a), sum(x)))