/*

A try towards peace

*/

#include <bits/stdc++.h>
using namespace std;
#define yo long long int
#define lo mp::cpp_int
#define pb push_back
#define pob pop_back
#define mp make_pair
#define endl "\n"
#define ce(x) cout << x <<"\n"
#define fill(s,v) memset(s,v,sizeof(s))
#define speed  { ios_base::sync_with_stdio(false); cin.tie(0); }
#define for2(i,a,b) for(yo i=a;i<b;i++)
#define for3(i,a,b) for(yo i=a;i<=b;i++)
#define for1(a,b) for(yo i=a;i<b;i++)
#define deb(x) cout<<#x<<" "<<x<<endl; 
#define INFINITE 1000000009
#define ull unsigned long long int
#define take(a,n) for(yo pp=0;pp<n;pp++) { cin>>a[pp]; }
#define take2(a,n) for(yo p=0;p<n;p++) { yo temp;cin>>temp;a.pb(temp); }
#define show(a,n) for(yo p=0;p<n;p++) cout<<a[p]<<" ";
#define _ <<" "<<
#define nl cout<<endl;
#define sq(x) ((x)*(x))
#define call(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define ff first
#define ss second
#define lld long double
#define tc(tt) \
    yo tt;    \
    cin >> tt; \
    for (int _tt = 0; _tt < tt; _tt++) 
 
yo dx[] = {1, 0, -1, 0};
yo dy[] = {0, 1, 0, -1};
const yo N = 1000*1000+5;
const yo size = 1000*100*2+5;
const yo mod = 1000*1000*1000+7;
 
yo gcd(yo a, yo b){if(!b)return a;return gcd(b, a % b);} 
yo power_mod(yo x,yo y,yo p){yo res=1;x%=p;while(y>0){if(y&1)res=(res*x)%p;y=y>>1;x=(x*x)%p;}return res;} 
yo lcm(yo a, yo b){return (a*b)/gcd(a, b);}
yo sumofdigits(yo n){yo out=0;while(n){out+=(n%10);n/=10;}return out;}
bool isPrime(yo n){if (n <= 1)  return false; if (n <= 3)  return true; if (n%2 == 0 || n%3 == 0) return false; for (yo i=5; i*i<=n; i=i+6) if (n%i == 0 || n%(i+2) == 0) return false;return true;} 
yo power(yo a,yo b){if(b==0)return 1;if(b&1)return a*power(a,b-1);yo res=power(a,b/2);return res*res;}
yo log(yo d){return log2(d);}
bool isPower(yo x, yo y){if(x==1) return (y==1); yo pow=1; while(pow<y) pow*=x; return(pow == y);}  
bool compare (const pair<yo,yo> &i,const pair<yo,yo> &j){return i.first < j.first;}
yo i,j;

lld polygonArea(lld X[], lld Y[], yo n) 
{   
    lld area = 0.0; 
    yo j = n - 1; 
    for (yo i = 0; i < n; i++) 
    { 
        area += (X[j] + X[i]) * (Y[j] - Y[i]); 
        j = i;  
    }    
    return abs(area); 
} 
bool prime[100200];
vector<yo> dp;
 
void SieveOfEratosthenes(yo n) 
{   
    for (yo p=2; p*p<=n; p++) 
    { 
        if (prime[p] == true) 
        { 
            for ( i=p*p; i<=n; i += p) 
                prime[i] = false;   
        } 
    } 
  
    for (yo p=2; p<=n; p++)  
       if (prime[p]) 
          dp.pb(p); 
} 

int main ()
{
    yo n,m; cin>>n>>m;

    yo ss=m;
    yo temp;
    yo count_wa=0,count_ac=0;
    bool check[n+5];
    fill(check,false);
    map<yo,yo> wa;

    while(ss--)
    {
        string s;
        cin>>temp;
        cin>>s;
        if(!check[temp] && s=="WA")
        {
            wa[temp]++;
        }
        else if(!check[temp] && s=="AC")
        {
            count_ac++;
            check[temp]=true;
        }
    }

    map<yo,yo>::iterator it;
    for(it=wa.begin();it!=wa.end();it++)
    {
        if(check[it->first])
        {
            count_wa+=(it->second);
        }
    }

    cout<<count_ac<<" "<<count_wa;
    nl

}
/*


200560490130



*/

Measured memory_bytes: 4224