module main; import std; void main() { auto N = readln.chomp.to!int; auto items = new int[](11); int ans = 0; foreach (_; 0 .. N) { int a, b, c; readln.chomp.formattedRead("%d %d %d", a, b, c); items[a]++, items[b]++, items[c]++; if (items[a] >= 2) { items[a] -= 2; ans++; } if (items[b] >= 2) { items[b] -= 2; ans++; } if (items[c] >= 2) { items[c] -= 2; ans++; } } writeln(ans + items.count(1) / 4); }