#!/usr/bin/env python3

import sys, math, itertools, collections, bisect

input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')

inf = float('inf') ;mod = 10**9+7

mans = inf ;ans = 0 ;count = 0 ;pro = 1



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

wa=0

data=[0]*(n+1)

AC=[0]*(n+1)

for i in range(m):

    p,s=input().split()

    p=int(p)

    if s=="WA":

        data[p]+=1

    else:

        AC[p]=1

        wa+=max(0,data[p])

        data[p]=-inf

# print(data)

print((sum(AC),wa))



        

    
import sys, math, itertools, collections, bisect

input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')

inf = float('inf') ;mod = 10**9+7

mans = inf ;ans = 0 ;count = 0 ;pro = 1

wa = 0

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

data = [0]*(n+1)

ans = [0]*(n+1)

for i in range(m):

  p,s = input().split()

  p = int(p)

  if s == "WA":

    data[p] += 1

  else:

    if ans[p] == 0:

      wa += data[p]

      ans[p] = 1

print((sum(ans),wa))

  

    
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect

input = lambda: sys.stdin.buffer.readline().rstrip().decode("utf-8")
inf = float("inf")
mod = 10**9 + 7
mans = inf
ans = 0
count = 0
pro = 1
n, m = list(map(int, input().split()))
wa = 0
data = [0] * (n + 1)
AC = [0] * (n + 1)
for i in range(m):
    p, s = input().split()
    p = int(p)
    if s == "WA":
        data[p] += 1
    else:
        AC[p] = 1
        wa += max(0, data[p])
        data[p] = -inf
# print(data)
print((sum(AC), wa))

import sys, math, itertools, collections, bisect

input = lambda: sys.stdin.buffer.readline().rstrip().decode("utf-8")
inf = float("inf")
mod = 10**9 + 7
mans = inf
ans = 0
count = 0
pro = 1
wa = 0
n, m = list(map(int, input().split()))
data = [0] * (n + 1)
ans = [0] * (n + 1)
for i in range(m):
    p, s = input().split()
    p = int(p)
    if s == "WA":
        data[p] += 1
    else:
        if ans[p] == 0:
            wa += data[p]
            ans[p] = 1
print((sum(ans), wa))

-#!/usr/bin/env python3 +wa = 0 -wa = 0 -AC = [0] * (n + 1) +ans = [0] * (n + 1) -        AC[p] = 1 -        wa += max(0, data[p]) -        data[p] = -inf -# print(data) -print((sum(AC), wa)) +        if ans[p] == 0: +            wa += data[p] +            ans[p] = 1 +print((sum(ans), wa))