module practiceA
  sub Main(ByVal args() as String)
    dim n,m as integer
    dim arr(2) as string
    dim p(100000) as integer
    arr=Split(Console.ReadLine())
    n=arr(0):m=arr(1)
    dim i as integer
    dim pn as integer
    dim res as string
    dim good, bad as integer
    for i = 0 to m-1
	    arr=Split(Console.ReadLine())
    	pn=arr(0):res=arr(1)
	    if res = "WA" and p(pn) = 0 then
    	  	bad = bad + 1
    	end if
      	if res = "AC" and p(pn) = 0 then
        	good = good + 1
        	p(pn) = 1
    	end if
  	next
  Console.Write(good)
  Console.Write(" ")
  Console.Write(bad)
	
end sub
end module