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

const int N = 1e5;

bool uda[N+5];
int cnt[N+5];
int n,m;

int main(){
	scanf("%d%d",&n,&m);
	int ac = 0;
	int pen = 0;
	for(int i=1;i<=m;i++){
		int x;
		string s;
		cin >> x >> s;
		if(s[0] == 'A'){
			if(uda[x]) continue;
			uda[x] = 1;
			ac++;
			pen+=cnt[x];
		} else {
			cnt[x]++;
		}
	}
	printf("%d %d\n",ac,pen);
	return 0;
}
