program main
      implicit none
      integer :: n, m, i
      integer, allocatable :: p(:)
      integer, allocatable :: ac(:), wa(:)
      character(2), allocatable :: s(:)

      read *, n, m
      allocate( p(m) )
      allocate( s(m) )
      do i = 1, m
        read *, p(i), s(i)
      end do
      
      allocate( ac(n) )
      allocate( wa(n) )
      ac = 0
      wa = 0
      do i = 1, m
        if ( s(i) == 'AC' ) then
          ac(p(i)) = 1
        else if ( s(i) == 'WA' ) then
          if ( ac(p(i)) == 1 ) then
          else
            wa(p(i)) = wa(p(i)) + 1
          end if
        end if
      end do 

      print *, sum(ac), sum(wa)
end program main
