#include //cin, cout #include //vector #include //sort,min,max,count #include //string,getline, to_string #include //abs(int) #include //swap, pair #include //deque #include //INT_MAX #include //bitset using namespace std; int main() { int N; cin >> N; int a, b, c; vector p(11); for (int i = 0; i < N; i++) { cin >> a >> b >> c; p[a]++; p[b]++; p[c]++; } int ans = 0; int oth = 0; for (int i = 1; i <= 10; i++) { ans += p[i] / 2; oth += p[i] % 2; } ans += oth / 4; cout << ans << endl; return 0; }