#include using namespace std; int main() { vector I(11); int N; cin >> N; for (int i = 0, a, b, c; i < N && cin >> a >> b >> c; i++) I.at(a)++, I.at(b)++, I.at(c)++; int x = 0, y = 0; for (int i = 1; i < 10; i++) x += I.at(i) / 2, y += I.at(i) % 2; cout << x + y / 4 << "\n"; }