package main import ( "fmt" ) func main(){ var n int fmt.Scan(&n) m := make([]int, 10) var a, b, c int for i := 0; i < n; i++ { fmt.Scan(&a, &b, &c) m[a - 1] += 1 m[b - 1] += 1 m[c - 1] += 1 } var two, four, cnt int for _, v := range m { if v >= 2 { two += v / 2 cnt += v - (v / 2) * 2 } else { cnt += v } if cnt >= 4 { four++ cnt = cnt - 4 } } fmt.Println(two + four) }