unittest
{
	assert( [ "2 5", "1 WA", "1 AC", "2 WA", "2 AC", "2 WA" ].parse.expand.solve == "2 2" );
	assert( [ "100000 3", "7777 AC", "7777 AC", "7777 AC" ].parse.expand.solve == "1 0" );
	assert( [ "6 0" ].parse.expand.solve == "0 0" );
}



import std.conv;
import std.format;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto nm = input.front.split.to!( long[] );
	auto pss = new Tuple!( long, bool )[ nm[ 1 ] ];
	foreach( ref ps; pss )
	{
		input.popFront;
		auto z = input.front.split;
		ps[ 0 ] = z[ 0 ].to!( long ) - 1;
		ps[ 1 ] = ( z[ 1 ] == "AC" );
	}
	return tuple( nm[ 0 ], pss );
}

auto solve( long n, Tuple!( long, bool )[] pss )
{
	auto as = new bool[ n ];
	auto ws = new long[ n ];
	foreach( ps; pss )
	{
		if( as[ ps[ 0 ] ] ) continue;
		if( ps[ 1 ] ) as[ ps[ 0 ] ] = true;
		else          ws[ ps[ 0 ] ]++;
	}
	
	auto ac = 0L;
	auto wa = 0L;
	foreach( a, w; lockstep( as, ws ) )
	{
		ac += a;
		if( a ) wa += w;
	}
	return format( "%s %s", ac, wa );
}
