n,m=io.read("*n","*n","*l")
t={}

if m==0 then
    print(0,0)
    return
end
for i=1,m do
    x=io.read()
    p,s=x:match("(%d+) (%u+)")
    if not t[p] then
        t[p]={}
        table.insert(t[p],s)
    else
        table.insert(t[p],s)
    end
end


wa_counter=0
ac_counter=0
for k,_ in pairs(t) do
    counter_flag=false
    for i=1,#t[k] do
        if t[k][i]=="AC" and not counter_flag then
            ac_counter=ac_counter+1
            counter_flag=true
        elseif t[k][i]=="WA" and not counter_flag then
            wa_counter=wa_counter+1
        end
    end
end

print(ac_counter,wa_counter)