program ABC151C
    implicit none
    integer(8)::N,M,p,i
    integer(8)::ac=0
    integer(8)::pen=0
    character(2)::S
    integer(8),allocatable,dimension(:)::flgs,w_count

    read(5,*)N,M
    allocate(flgs(N))
    allocate(w_count(N))
    flgs=0
    w_count=0

    if(M/=0)then
        do i=1,M
            read(5,*)p,S

            if(S=="WA")then
                if(flgs(p)==0)then
                    w_count(p)=w_count(p)+1
                end if
            else if(S=="AC")then
                if(flgs(p)==0)then
                    ac=ac+1
                    flgs(p)=1
                end if
            end if
        end do

        do i=1,N
            pen=pen+w_count(i)
        end do
    end if

    print'(i0,1x,i0)',ac,pen
end program ABC151C