import std.algorithm, std.array, std.range; import std.string, std.conv; import std.stdio, std.typecons; void main() { auto n = readln.chomp.to!int; auto abci = iota(n).map!(i => readln.split.map!(to!int).map!(i => i - 1)); auto items = [0,0,0,0,0,0,0,0,0,0]; foreach (abc; abci) { foreach (i; abc) { items[i] += 1; } } auto r = 0; foreach (ref item; items) { r += item / 2; item %= 2; } writeln(r + count!("a == 1")(items) / 4); }