#include using namespace std; #define rep(i, a, n) for(int i = a; i < (n); ++i) int main(){ int n; cin >> n; int items[10]; int a, b, c; int count = 0; rep(i, 0, n) { cin >> a >> b >> c; --a; --b; --c; ++items[a]; if (items[a] % 2 == 0) { ++count; items[a] = 0; } ++items[b]; if (items[b] % 2 == 0) { ++count; items[b] = 0; } ++items[c]; if (items[c] % 2 == 0) { ++count; items[c] = 0; } } int tmp = 0; rep(i, 0, 10) { tmp += items[i]; if (tmp % 4 == 0) { tmp %= 4; ++count; } } cout << count << endl; }