let inputCount = Int(readLine()!)! var cnt = [Int:Int]() var ans = 0 for i in 1...inputCount { let inpt = readLine()!.split(separator: " ").map{Int($0)!} for j in 0...inpt.count-1 { if(cnt[inpt[j]]==nil) { cnt[inpt[j]] = 1 } else { ans+=1 cnt.removeValue(forKey:inpt[j]) } } } ans+=cnt.count/4 print(ans)