program main

  implicit none

  integer :: n, m, i, j, nac, nwa
  integer,allocatable :: p(:)
  character(2),allocatable ::  s(:)
  
  read(*,*) n, m
  allocate( p(m) )
  allocate( s(m) )

  do i = 1, m 
    read(*,*) p(i), s(i)
  end do
  
  nac = 0; nwa = 0 
  do j = 1, n 
    do i = 1, m 
      if ( s(i) == "WA" .and. j == p(i) ) then
        nwa = nwa + 1
!        print*, j, i, nwa, nac 
      end if
      if ( s(i) == "AC" .and. j == p(i) ) then
        nac = nac + 1
!        print*, j, i, nwa, nac 
        exit
      end if
    end do
  end do

  print*, nac, nwa

  
end program main
