program welcome_to_atcoder
    implicit none
    integer(4):: n, m, i, all_ac, all_pena
    integer(4), allocatable:: p(:),pena(:)
    character(2), allocatable:: s(:)
    logical, allocatable:: is_ac(:)
    read*, n, m
    allocate(p(m), s(m), is_ac(n), pena(n))
    do i=1, m
        read*, p(i),s(i)
    end do
    is_ac(:) = .false.
    pena(:) = 0
    do i=1, m
        if (s(i) == "AC") then
            is_ac(p(i)) = .true.
        else
            if (.not. is_ac(p(i))) pena(p(i)) = pena(p(i)) + 1
        end if
    end do

    all_ac = 0
    all_pena = 0

    do i=1, n
        if (is_ac(i)) then
            all_ac = all_ac + 1
            all_pena = all_pena + pena(i)    
        end if    
    end do

    print"(i01xi0)", all_ac, all_pena

    
end program welcome_to_atcoder