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.buffer.readline

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

  a,w,l,k=0,0,[0]*n,[0]*m

  for _ in k:

    p,s=input().split()

    p=int(p)-1

    if l[p]>=0:

      if s==b'AC':

        a+=1

        w+=l[p]

        l[p]=-1

      else:

        l[p]+=1

  print((a,w))

  

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.buffer.readline
    n, m = list(map(int, input().split()))
    a, w, l, k = 0, 0, [0] * n, [0] * m
    for _ in k:
        p, s = input().split()
        p = int(p) - 1
        if l[p] >= 0:
            if s == b"AC":
                a += 1
                w += l[p]
                l[p] = -1
            else:
                l[p] += 1
    print((a, w))


if __name__ == "__main__":
    main()

-    ac, wa, l, k = 0, 0, [0] * n, [0] * m +    a, w, l, k = 0, 0, [0] * n, [0] * m -        p = int(p) -        if type(l[p - 1]) == int: +        p = int(p) - 1 +        if l[p] >= 0: -                ac += 1 -                wa += l[p - 1] -                l[p - 1] = "" +                a += 1 +                w += l[p] +                l[p] = -1 -                l[p - 1] += 1 -    print((ac, wa)) +                l[p] += 1 +    print((a, w))