#include using namespace std; typedef long long ll; typedef pair pii; #define pb push_back #define mp make_pair #define rep(i,n) for(int i=0;i<(n);++i) int main(){ cin.tie(0); ios::sync_with_stdio(false); int n;cin >> n; vector A(10); rep(i,n){ int a,b,c;cin >> a >> b >> c; A[a-1]++; A[b-1]++; A[c-1]++; } int ans=0; rep(i,10){ ans+=A[i]/2; A[i]%=2; } int cnt=0; rep(i,10){ cnt+=A[i]; } ans+=cnt/4; cout << ans << endl; }