// graph struct Graph { node: i32, adjMatrixs: Vec>, } struct WeightGraph { node: i32, weight: Vec>, } // points struct Point { x: i32, y: i32, } struct PointGroup{ n: i32, point:Point, } use std::io; fn read_line() -> String { let mut s = String::new(); io::stdin().read_line(&mut s).unwrap(); s } macro_rules! from_line { ($($a:ident : $t:ty),+) => { $(let $a: $t;)+ { let _line = read_line(); let mut _it = _line.trim().split_whitespace(); $($a = _it.next().unwrap().parse().unwrap();)+ assert!(_it.next().is_none()); } }; } fn solve(){ from_line!(n: usize); let mut s = vec![vec![String::new();4];n]; let model = ["akai", "marui", "okii", "umai"]; for i in 0..n{ from_line!(a:String,b:String,c:String,d:String); s[i] = vec![a,b,c,d]; } let mut count = 0; 'counter: for i in 0..n{ s[i].sort(); // println!("{:?}",s[i]); for j in 0..4{ if s[i][j] != model[j]{ continue 'counter; } } count += 1; // println!("{} {}",i,count); } println!("{}",count); } fn main() { solve(); }