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()
def main():

  import sys

  input = sys.stdin.buffer.readline

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

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

  for _ in k:

    p,s=input().split()

    p=int(p)

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

      if s==b'AC':

        ac+=1

        wa+=l[p-1]

        l[p-1]=''

      else:

        l[p-1]+=1

  print((ac,wa))

  

if __name__ == '__main__':

    main()
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()

def main():
    import sys

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


if __name__ == "__main__":
    main()

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