#include using namespace std; #define rep(i,n) for(int (i) = 0 ; (i) < (int)(n) ; (i)++) #define REP(i,a,b) for(int (i) = a ; (int)(i) <= (int)(b) ; (i)++) #define all(n) (n).begin(),(n).end() typedef vector Vi; typedef vector VVi; typedef pair Pii; typedef vector VPii; int main(){ int N; cin >> N; int C[11] = {}; rep(i,N){ int a,b,c; cin >> a >> b >> c; C[a]++; C[b]++; C[c]++; } int ans = 0; int sub = 0; REP(i,1,10){ ans += C[i] / 2; sub += C[i] % 2; } cout << ans + sub / 4 << endl; }