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



result = [False]*n

count = [0]*n

for _ in range(m):

  p,s = input().split()

  p = int(p)-1

  if not result[p]:

    if s == "AC": result[p] = True

    else: count[p] += 1

      

ng = 0

for i in range(n):

  if result[i]:

    ng += count[i]

print((result.count(True),ng))
n,m = list(map(int, input().split()))



flag = [False]*n

wa = [0]*n

for _ in range(m):

  p,s = input().split()

  p = int(p)-1

  if not flag[p]:

    if s == "WA":

      wa[p] += 1

    else: flag[p] = True



count = 0

for i in range(n):

  if flag[i]: count += wa[i]



print((flag.count(True), count))
n, m = list(map(int, input().split()))
result = [False] * n
count = [0] * n
for _ in range(m):
    p, s = input().split()
    p = int(p) - 1
    if not result[p]:
        if s == "AC":
            result[p] = True
        else:
            count[p] += 1
ng = 0
for i in range(n):
    if result[i]:
        ng += count[i]
print((result.count(True), ng))

n, m = list(map(int, input().split()))
flag = [False] * n
wa = [0] * n
for _ in range(m):
    p, s = input().split()
    p = int(p) - 1
    if not flag[p]:
        if s == "WA":
            wa[p] += 1
        else:
            flag[p] = True
count = 0
for i in range(n):
    if flag[i]:
        count += wa[i]
print((flag.count(True), count))

-result = [False] * n -count = [0] * n +flag = [False] * n +wa = [0] * n -    if not result[p]: -        if s == "AC": -            result[p] = True +    if not flag[p]: +        if s == "WA": +            wa[p] += 1 -            count[p] += 1 -ng = 0 +            flag[p] = True +count = 0 -    if result[i]: -        ng += count[i] -print((result.count(True), ng)) +    if flag[i]: +        count += wa[i] +print((flag.count(True), count))