#include<bits/stdc++.h>
const int maxn=1e5+9;
using namespace std;
int main()
{
	int i,ac=0,wa=0,vis[maxn]={0},x,n,m,sum[maxn]={0};
	char s[10];
	scanf("%d%d",&n,&m);
	while(m--)
	{
		scanf("%d%s",&x,s);
		if(vis[x])continue;
		if(s[0]=='A')vis[x]=1,ac++,wa+=sum[x];
		else sum[x]++;
	}
	printf("%d %d\n",ac,wa);
}