use std::io::Read; fn main() { let mut s: String = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let mut itr = s.trim().split_whitespace(); let n: usize = itr.next().unwrap().parse().unwrap(); let mut cnt = vec![0; 11]; for _ in 0..n { let a: usize = itr.next().unwrap().parse().unwrap(); let b: usize = itr.next().unwrap().parse().unwrap(); let c: usize = itr.next().unwrap().parse().unwrap(); cnt[a] += 1; cnt[b] += 1; cnt[c] += 1; } let mut ans = 0; let mut rem = 0; for i in 1..11 { ans += cnt[i] / 2; rem += cnt[i] % 2; } ans += rem / 4; println!("{}", ans); }