      PROGRAM welcomeToAtcoder
      IMPLICIT NONE
      integer(16) :: n,m
      integer(16),allocatable :: p(:)
      character(2),allocatable :: s(:)
      integer(16) :: i
      logical,allocatable :: flag(:)
      integer(16) :: ac=0,wa=0
      
      
      read*,n,m
      allocate( p(m),s(m),flag(n) )
      do i = 1,m
        read*,p(i),s(i)
      end do
      
      
      flag(:) = .true.
      do i = 1,m
        if( flag(p(i)) )then
          if( s(i)(1:2)=='AC' )then
            ac = ac + 1
            flag(p(i)) = .false.
          else
            wa = wa + 1
          end if
        end if
      end do
      
      print*,ac,wa
      
      
      END PROGRAM