import numpy as np

from collections import Counter

import fractions

import math



def main():

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

  p_list, s_list = ["a"] * m, ["a"] * m

  for i in range(m):

    p_list[i], s_list[i] = list(map(str, input().split()))

    p_list[i] = int(p_list[i])

  pena = 0

  mon_list, pena_list = [0] * n, [0] * n

  for i in range(m):

    if s_list[i] == "AC":

      mon_list[p_list[i] - 1] = 1

    if mon_list[p_list[i] - 1] == 0:

      if s_list[i] == "WA":

        pena_list[p_list[i] - 1] += 1

  for i in range(n):

    if mon_list[i] == 1:

      pena += pena_list[i]

  ac = mon_list.count(1)

  print((ac, pena))



main()
import math

import collections

import fractions

import itertools



def solve():

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

    mon = [0]*n

    mon2 = [0]*n

    for i in range(m):

        q, a = input().split()

        q = int(q)

        if a == "AC":

            mon[q-1] = 1

        else:

            if mon[q-1] == 0:

                mon2[q-1] += 1

    ac, pena = 0, 0

    for i in range(n):

        if mon[i] == 1:

            ac += 1

            pena += mon2[i]

    print((ac, pena))

    return 0



if __name__ == "__main__":

    solve()

import numpy as np
from collections import Counter
import fractions
import math


def main():
    n, m = list(map(int, input().split()))
    p_list, s_list = ["a"] * m, ["a"] * m
    for i in range(m):
        p_list[i], s_list[i] = list(map(str, input().split()))
        p_list[i] = int(p_list[i])
    pena = 0
    mon_list, pena_list = [0] * n, [0] * n
    for i in range(m):
        if s_list[i] == "AC":
            mon_list[p_list[i] - 1] = 1
        if mon_list[p_list[i] - 1] == 0:
            if s_list[i] == "WA":
                pena_list[p_list[i] - 1] += 1
    for i in range(n):
        if mon_list[i] == 1:
            pena += pena_list[i]
    ac = mon_list.count(1)
    print((ac, pena))


main()

import math
import collections
import fractions
import itertools


def solve():
    n, m = list(map(int, input().split()))
    mon = [0] * n
    mon2 = [0] * n
    for i in range(m):
        q, a = input().split()
        q = int(q)
        if a == "AC":
            mon[q - 1] = 1
        else:
            if mon[q - 1] == 0:
                mon2[q - 1] += 1
    ac, pena = 0, 0
    for i in range(n):
        if mon[i] == 1:
            ac += 1
            pena += mon2[i]
    print((ac, pena))
    return 0


if __name__ == "__main__":
    solve()

-import numpy as np -from collections import Counter +import math +import collections -import math +import itertools -def main(): +def solve(): -    p_list, s_list = ["a"] * m, ["a"] * m +    mon = [0] * n +    mon2 = [0] * n -        p_list[i], s_list[i] = list(map(str, input().split())) -        p_list[i] = int(p_list[i]) -    pena = 0 -    mon_list, pena_list = [0] * n, [0] * n -    for i in range(m): -        if s_list[i] == "AC": -            mon_list[p_list[i] - 1] = 1 -        if mon_list[p_list[i] - 1] == 0: -            if s_list[i] == "WA": -                pena_list[p_list[i] - 1] += 1 +        q, a = input().split() +        q = int(q) +        if a == "AC": +            mon[q - 1] = 1 +        else: +            if mon[q - 1] == 0: +                mon2[q - 1] += 1 +    ac, pena = 0, 0 -        if mon_list[i] == 1: -            pena += pena_list[i] -    ac = mon_list.count(1) +        if mon[i] == 1: +            ac += 1 +            pena += mon2[i] +    return 0 -main() +if __name__ == "__main__": +    solve()