module kkk
  Sub main()
    
    Dim kekka() As String
    Dim moji As String
    Dim NM
    Dim P()
    dim S()
    Dim i As Long
    dim k as Long
    dim kkk() as boolean
    dim cnt as Long
    dim cnt2 as Long
    
    moji = Console.ReadLine()
    NM = Split(moji, " ")
    
    ReDim kekka(NM(1) - 1)
    ReDim P(NM(1) - 1)
    ReDim S(NM(1) - 1)
    ReDim kkk(NM(0) - 1)
    
    For i = 0 To NM(1) - 1
    kekka(i) = Console.ReadLine()
    P(i) = Left(kekka(i), InStr(kekka(i), " ") - 1)
    S(i) = Right(kekka(i), Len(kekka(i)) - InStr(kekka(i), " "))
  Next
  
  for k = 1 to NM(0)
  for i = 0 to NM(1) - 1
  if P(i) = k then
    if S(i) = "AC" then
      cnt = cnt + 1
      kkk(k - 1) = True
        if not i = NM(1) - 1 then
          i = i + 1
        end if
      else
        if kkk(k - 1) = true then
          cnt2 = cnt2 + 1
        end if
    end if
  end if
next
next

Console.WriteLine(cnt & " " & cnt2)

end sub
end module

  