#include<bits/stdc++.h>
using namespace std;
int n,m,x,ans,ans1,f[100001],e[100001];
char y[10];
int main(){
	ios::sync_with_stdio(false);
	cin>>n>>m;
	for(int i=1;i<=m;i++){
		cin>>x>>y;
		if(y[0]+y[1]=='A'+'C'){
			if(!f[x])ans++,f[x]=1,ans1+=e[x];
		}
		else e[x]++;
	}
	printf("%d %d\n",ans,ans1);
	return 0;
}