program kk
	implicit none
    integer :: n, i, ac, wa, tle, re
    character, allocatable :: s(:)
    
    read(*,*) n
    allocate(s(n))
    read(*,*) s
    !print *, s
    ac = 0
    wa = 0
    tle = 0
    re = 0
    do i = 1, n
    	if (s(i) == 'A') then
        	ac = ac + 1
        else if(s(i) == 'W') then
        	wa = wa + 1
        else if(s(i) == 'T') then
        	tle = tle + 1
        else if (s(i) == 'R') then
        	re = re + 1
        end if
    end do
    print *, 'AC x ', ac
    print *, 'WA x ', wa
    print *, 'TLE x ', tle
    print *, 'RE x ', re
end program kk