# ABC151 C

si = lambda: eval(input())

ni = lambda: int(eval(input()))

nm = lambda: list(map(str, input().split()))

nl = lambda: list(map(int, input().split()))

from collections import defaultdict

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

ac=set()

ac_cnt=0

wa_cnt=0

d_ac=defaultdict(int)

d_wa=defaultdict(int)

for i in range(m):

    p,s=nm()

    if s=='AC':

        if int(p) in ac:

            continue

        ac.add(int(p))

        ac_cnt+=1

    elif s=='WA':

        if int(p) in ac:

            continue

        d_wa[p]+=1



for a in ac:

    wa_cnt+=d_wa[str(a)]



print((ac_cnt,wa_cnt))



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

ac,wa=0,0

ac_set=set()

wa_cnt=[0]*(n+1)

for i in range(m):

  p,s=list(map(str,input().split()))

  p=int(p)

  if s=="AC":

    if p in ac_set:

      continue

    ac_set.add(p)

  else:

    if p in ac_set:

      continue

    wa_cnt[p]+=1

ac=len(ac_set)

for a in ac_set:

  wa+=wa_cnt[a]

print((ac,wa))
# ABC151 C
si = lambda: eval(input())
ni = lambda: int(eval(input()))
nm = lambda: list(map(str, input().split()))
nl = lambda: list(map(int, input().split()))
from collections import defaultdict

n, m = list(map(int, input().split()))
ac = set()
ac_cnt = 0
wa_cnt = 0
d_ac = defaultdict(int)
d_wa = defaultdict(int)
for i in range(m):
    p, s = nm()
    if s == "AC":
        if int(p) in ac:
            continue
        ac.add(int(p))
        ac_cnt += 1
    elif s == "WA":
        if int(p) in ac:
            continue
        d_wa[p] += 1
for a in ac:
    wa_cnt += d_wa[str(a)]
print((ac_cnt, wa_cnt))

n, m = list(map(int, input().split()))
ac, wa = 0, 0
ac_set = set()
wa_cnt = [0] * (n + 1)
for i in range(m):
    p, s = list(map(str, input().split()))
    p = int(p)
    if s == "AC":
        if p in ac_set:
            continue
        ac_set.add(p)
    else:
        if p in ac_set:
            continue
        wa_cnt[p] += 1
ac = len(ac_set)
for a in ac_set:
    wa += wa_cnt[a]
print((ac, wa))

-# ABC151 C -si = lambda: eval(input()) -ni = lambda: int(eval(input())) -nm = lambda: list(map(str, input().split())) -nl = lambda: list(map(int, input().split())) -from collections import defaultdict - -ac = set() -ac_cnt = 0 -wa_cnt = 0 -d_ac = defaultdict(int) -d_wa = defaultdict(int) +ac, wa = 0, 0 +ac_set = set() +wa_cnt = [0] * (n + 1) -    p, s = nm() +    p, s = list(map(str, input().split())) +    p = int(p) -        if int(p) in ac: +        if p in ac_set: -        ac.add(int(p)) -        ac_cnt += 1 -    elif s == "WA": -        if int(p) in ac: +        ac_set.add(p) +    else: +        if p in ac_set: -        d_wa[p] += 1 -for a in ac: -    wa_cnt += d_wa[str(a)] -print((ac_cnt, wa_cnt)) +        wa_cnt[p] += 1 +ac = len(ac_set) +for a in ac_set: +    wa += wa_cnt[a] +print((ac, wa))