#from statistics import median

#import collections

#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]

from fractions import gcd

from itertools import combinations,permutations,accumulate # (string,3) 3回

#from collections import deque

from collections import deque,defaultdict,Counter

import decimal

#import bisect

#

#    d = m - k[i] - k[j]

#    if kk[bisect.bisect_right(kk,d) - 1] == d:

#

#

#

# pythonで無理なときは、pypyでやると正解するかも！！

#

#



import sys

sys.setrecursionlimit(10000000)

mod = 10**9 + 7

#mod = 9982443453

def readInts():

  return list(map(int,input().split()))

def I():

  return int(eval(input()))

n,m = readInts()

dic = defaultdict(int)

A = set()

for i in range(m):

    a,b = input().split()

    if dic['AC'+a] != 1:

        if b == 'AC':

            dic['AC'] += 1

            dic['AC'+a] = 1

        else:

            dic['WA'] += 1

            dic['WA'+a] += 1

    A.add(a)

for a in A:

    if dic['AC'+a] != 1:

        dic['WA'] -= dic['WA'+a]

print((dic['AC'],dic['WA']))

#from statistics import median

#import collections

#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]

from fractions import gcd

from itertools import combinations,permutations,accumulate # (string,3) 3回

#from collections import deque

from collections import deque,defaultdict,Counter

import decimal

import re

#import bisect

#

#    d = m - k[i] - k[j]

#    if kk[bisect.bisect_right(kk,d) - 1] == d:

#

#

#

# pythonで無理なときは、pypyでやると正解するかも！！

#

#



import sys

sys.setrecursionlimit(10000000)

mod = 10**9 + 7

#mod = 9982443453

def readInts():

  return list(map(int,input().split()))

def I():

  return int(eval(input()))

n,m = readInts()

dic = defaultdict(int)

cnt = 0

ans = 0

for i in range(m):

    i,j = input().split()

    if dic[i] != -1:

        if j == 'WA':

            dic[i] += 1

        elif j == 'AC':

            cnt += 1

            ans += dic[i]

            dic[i] = -1

print((cnt,ans))

# from statistics import median
# import collections
# aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations, permutations, accumulate  # (string,3) 3回

# from collections import deque
from collections import deque, defaultdict, Counter
import decimal

# import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
import sys

sys.setrecursionlimit(10000000)
mod = 10**9 + 7
# mod = 9982443453
def readInts():
    return list(map(int, input().split()))


def I():
    return int(eval(input()))


n, m = readInts()
dic = defaultdict(int)
A = set()
for i in range(m):
    a, b = input().split()
    if dic["AC" + a] != 1:
        if b == "AC":
            dic["AC"] += 1
            dic["AC" + a] = 1
        else:
            dic["WA"] += 1
            dic["WA" + a] += 1
    A.add(a)
for a in A:
    if dic["AC" + a] != 1:
        dic["WA"] -= dic["WA" + a]
print((dic["AC"], dic["WA"]))

# from statistics import median
# import collections
# aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations, permutations, accumulate  # (string,3) 3回

# from collections import deque
from collections import deque, defaultdict, Counter
import decimal
import re

# import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
import sys

sys.setrecursionlimit(10000000)
mod = 10**9 + 7
# mod = 9982443453
def readInts():
    return list(map(int, input().split()))


def I():
    return int(eval(input()))


n, m = readInts()
dic = defaultdict(int)
cnt = 0
ans = 0
for i in range(m):
    i, j = input().split()
    if dic[i] != -1:
        if j == "WA":
            dic[i] += 1
        elif j == "AC":
            cnt += 1
            ans += dic[i]
            dic[i] = -1
print((cnt, ans))

+import re -A = set() +cnt = 0 +ans = 0 -    a, b = input().split() -    if dic["AC" + a] != 1: -        if b == "AC": -            dic["AC"] += 1 -            dic["AC" + a] = 1 -        else: -            dic["WA"] += 1 -            dic["WA" + a] += 1 -    A.add(a) -for a in A: -    if dic["AC" + a] != 1: -        dic["WA"] -= dic["WA" + a] -print((dic["AC"], dic["WA"])) +    i, j = input().split() +    if dic[i] != -1: +        if j == "WA": +            dic[i] += 1 +        elif j == "AC": +            cnt += 1 +            ans += dic[i] +            dic[i] = -1 +print((cnt, ans))