#include #define FOR(i,a,b) for(int i = (a); i < (b); ++i) using namespace std; int main() { int n; cin >> n; int item[16] = { 0 }; FOR(i, 0, n) { int a, b, c; cin >> a >> b >> c; item[a]++; item[b]++; item[c]++; } int cnt = 0, sum = 0; FOR(i, 1, 11) { cnt += item[i] / 2; sum += item[i] % 2; } cout << cnt + sum / 4 << endl; return 0; }