#include using namespace std; int main() { int N; cin >> N; vector v(100, 0); for (int i = 0; i < N; i++) { int a, b, c; cin >> a >> b >> c; v.at(a - 1)++; v.at(b - 1)++; v.at(c - 1)++; } sort(v.begin(), v.end()); reverse(v.begin(), v.end()); int sum = 0; for (int i = 0; i < v.size(); i++) { int& p = v.at(i); if (p < 2) break; sum += p / 2; p %= 2; } int c = 0; for (int i = 0; i < v.size(); i++) { if (v.at(i) == 1) { c++; } if (i == v.size() - 1) { sum += c / 4; } } cout << sum << endl; }