#include using namespace std; int main() { int item[10] = { 0 }; int N; int item_num = 0; int up_times = 0; cin >> N; for (int i = 0; i < N;i++) { int a, b, c; cin >> a >> b >> c; if (++item[a - 1] == 2) { up_times++; item[a - 1] = 0; } if (++item[b - 1] == 2) { up_times++; item[b - 1] = 0; } if (++item[c - 1] == 2) { up_times++; item[c - 1] = 0; } } for (int i = 0; i < 10;i++) { item_num += item[i]; } up_times += (item_num / 4); cout << up_times << endl; return 0; }