#include using namespace std; signed main(){ int N; cin >> N; vector< int > cnt( 10 + 1 ); for( int i = 0; i < N; ++i ){ int A, B, C; cin >> A >> B >> C; ++cnt[ A ], ++cnt[ B ], ++cnt[ C ]; } int ans = 0, used = 0; for( int i = 1; i <= 10; ++i ) ans += cnt[ i ] / 2, used += cnt[ i ] / 2 * 2, cnt[ i ] = cnt[ i ] / 2 * 2; ans += ( N * 3 - used ) / 4; cout << ans << endl; return 0; }