import std.stdio, std.conv, std.string, std.range, std.algorithm; void main() { auto N = readln.strip.to!int; int[] A, B, C; foreach (_; 0 .. N) { auto input = readln.split.to!(int[]); A ~= input[0]; B ~= input[1]; C ~= input[2]; } auto inventory = new int[11]; int ans; chain(A, B, C).each!(item => inventory[item]++); ans = inventory.map!"a/2".sum; ans += inventory.map!"a%2".count!"a>0" / 4; ans.writeln; }