use proconio::input;

fn main() {
   
    input! {
        n: u32,
        string: [String ; n], 
    }
    let mut ac=0;
    let mut wa=0;
    let mut tle=0;
    let mut re=0;

    for i in string{
        if i == "AC"{
            ac=ac+1;
        }else if i == "WA"{
            wa+=1;
        }else if i == "TLE"{
            tle+=1;
        }else if i == "RE"{
            re+=1;
        }
    }

    println!{"AC * {}", ac}
    println!{"WA * {}", wa}
    println!{"TLE * {}", tle}
    println!{"RE * {}", re}
}
