#include<bits/stdc++.h>
using namespace std;

const int maxn=1e5+6;
int vis[maxn],c[maxn],cnt,ans;
int n,m;

int main()
{
	scanf("%d %d",&n,&m);
	for(int i=1;i<=m;++i) {
		int a;char s[4];
		scanf("%d",&a);
		scanf("%s",s);
		if(s[0]=='A'&&vis[a]==0) cnt++,ans+=c[a],vis[a]=1;
		else c[a]++;
	}
	printf("%d %d",cnt,ans);
}