#include #define rep(i,n)for(long long i=0;i<(n);i++) using namespace std; typedef long long ll; const int MOD=1e9+7; const int MAX = 1000000; const ll INF = (1LL << 31) - 1; const double pi=acos(-1); int main(){ int n; cin >> n; vectorvec(10); rep(i,n){ int a,b,c; cin >> a >> b >> c; a--; b--; c--; vec[a]++; vec[b]++; vec[c]++; } int ans=0; rep(i,10){ ans+=vec[i]/2; if(vec[i]%2==0)vec[i]=0; else vec[i]=1; } int sum=0; rep(i,10){ sum+=vec[i]; } ans+=sum/4; cout << ans << endl; }