fn main() {
    let n: i32 = read();
    let mut ac: i32 = 0;
    let mut wa: i32 = 0;
    let mut lte: i32 = 0;
    let mut re: i32 = 0;

    for _ in 0..n {
        let result: String = read();

        if result == "AC" {
            ac += 1;
        } else if result == "WA" {
            wa += 1;
        } else if result == "LTE" {
            lte += 1;
        } else if result == "RE" {
            re += 1;
        }
    }

    println!("AC x {}", ac);
    println!("WA x {}", wa);
    println!("LTE x {}", lte);
    println!("RE x {}", re);
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}
