program main

  implicit none

  integer    :: n, m, i, j
  integer(8) :: nac, nwa
  integer,allocatable :: p(:), jj(:)
  character(2),allocatable ::  s(:)
  
  read(*,*) n, m
  allocate( p(m) )
  allocate( s(m) )
  allocate( jj(n) ); jj = 0

  do i = 1, m 
    read(*,*) p(i), s(i)
  end do
  
  nac = 0
  nwa = 0
  do i = 1, m 
    if ( s(i) == "AC" .and. jj( p(i) ) == 0 ) then
      nac = nac + 1
      jj( p(i) ) = jj( p(i) ) + 1
    else if ( s(i) == "WA" .and. jj( p(i) ) == 0 ) then
      nwa = nwa + 1
    end if
  end do

  print*, nac, nwa
  
end program main
