#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int N, s, AC1, WA1, TLE1, RE1;
    
    string AC, WA, TLE, RE;
    
    AC1=0;
    WA1=0;
    TLE1=0;
    RE1=0;
    
    cin >> s;
    
    if(cin >> "AC"){
        
        AC1=AC1+1;
    }
    
    else if(cin >> "WA"){
        
        WA1=WA1+1;
    }
    
    else if(cin >> "TLE"){
        
        TLE1=TLE1+1;
    }
    
    else if(cin >> "RE"){
        
        RE1=RE1+1;
        
    }
    
    cout << "AC=" << AC1 << endl;
    cout << "WA=" << WA1 << endl;
    cout << "TLE=" << TLE1 << endl;
    cout << "RE=" << RE1 << endl;
}