import std.stdio, std.string, std.conv ,std.array, std.algorithm; void main(){ auto N = readln().strip().to!int(); int[11] fl; foreach(immutable int i; 0 .. N) { auto ln = readln().strip().split().map!(to!int)(); foreach(immutable int j; 0 .. 3) ++ fl[ln[j]]; } int i2 = reduce!("a + b/2")(0, fl); writeln(i2 + (3*N - 2*i2)/4); }