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

ac,wa,k,l=0,0,[0]*n,[0]*n

for _ in range(m):

  p,s=input().split()

  if k[int(p)-1]==0:

    if s=='AC':

      ac+=1

      k[int(p)-1]=1

      wa+= l[int(p)-1]

    else:

      l[int(p)-1]+=1

print((ac,wa))
def main():

  import sys

  input = sys.stdin.readline

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

  ac,wa,l=0,0,[0]*n

  for _ in [0]*m:

    p,s=input().split()

    if type(l[int(p)-1])==int:

      if s=='AC':

        ac+=1

        wa+= l[int(p)-1]

        l[int(p)-1]=str(l[int(p)-1])

      else:

        l[int(p)-1]+=1

  print((ac,wa))

  

if __name__ == '__main__':

    main()
n, m = list(map(int, input().split()))
ac, wa, k, l = 0, 0, [0] * n, [0] * n
for _ in range(m):
    p, s = input().split()
    if k[int(p) - 1] == 0:
        if s == "AC":
            ac += 1
            k[int(p) - 1] = 1
            wa += l[int(p) - 1]
        else:
            l[int(p) - 1] += 1
print((ac, wa))

def main():
    import sys

    input = sys.stdin.readline
    n, m = list(map(int, input().split()))
    ac, wa, l = 0, 0, [0] * n
    for _ in [0] * m:
        p, s = input().split()
        if type(l[int(p) - 1]) == int:
            if s == "AC":
                ac += 1
                wa += l[int(p) - 1]
                l[int(p) - 1] = str(l[int(p) - 1])
            else:
                l[int(p) - 1] += 1
    print((ac, wa))


if __name__ == "__main__":
    main()

-n, m = list(map(int, input().split())) -ac, wa, k, l = 0, 0, [0] * n, [0] * n -for _ in range(m): -    p, s = input().split() -    if k[int(p) - 1] == 0: -        if s == "AC": -            ac += 1 -            k[int(p) - 1] = 1 -            wa += l[int(p) - 1] -        else: -            l[int(p) - 1] += 1 -print((ac, wa)) +def main(): +    import sys + +    input = sys.stdin.readline +    n, m = list(map(int, input().split())) +    ac, wa, l = 0, 0, [0] * n +    for _ in [0] * m: +        p, s = input().split() +        if type(l[int(p) - 1]) == int: +            if s == "AC": +                ac += 1 +                wa += l[int(p) - 1] +                l[int(p) - 1] = str(l[int(p) - 1]) +            else: +                l[int(p) - 1] += 1 +    print((ac, wa)) + + +if __name__ == "__main__": +    main()