local read = setmetatable({}, {__index = function(t, k) local a = {} for i=1,#k do table.insert(a, '*'..string.sub(k, i, i)) end local r = io.read local u = table.unpack or unpack return function() return r(u(a)) end end})
read.N = function(N) local t={} for i=1,N do t[i]=read.n() end return t end
string.totable = function(s) local t={} local u=string.sub for i=1,#s do t[i] = u(s, i, i) end return t end
string.split = function(s) local t={} for w in string.gmatch(s, "[^%s]+") do table.insert(t, w) end return (table.unpack or unpack)(t) end
----
local N, M = read.nnl()
local task_completed = {}
local ac_count = 0
local wa_count = 0
for i=1,M do
    local p, s = read.l():split()
    if not task_completed[p] then
        if s == 'AC' then
            ac_count = ac_count + 1
            task_completed[p] = true
        else
            wa_count = wa_count + 1
        end
    end
end
print(ac_count .. " " .. wa_count)