#include #define REP(i,n) for(int i=0; i<(n); i++) using namespace std; struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; int main() { int N; cin >> N; vector vc( N*3 ); for( auto& x : vc ) { cin >> x; } sort( vc.begin(), vc.end() ); int count{}, tmp{}; REP( i, N*3 ) { if( vc[i] == vc[i+1] ) { count++; i += 1; } else { tmp++; if( tmp == 4 ) { count++; tmp = 0; } } } cout << count << endl; return 0; }