#include using namespace std; int main() { int N; cin >> N; int ans = 0; vector cnt(10, 0); for (int i = 0; i < N; i++) { int a, b, c; cin >> a >> b >> c; a--; b--; c--; cnt[a]++; cnt[b]++; cnt[c]++; } int tmp = 0; for (int i = 0; i < 10; i++) { ans += cnt[i] / 2; tmp += cnt[i] % 2; } ans += tmp / 4; printf("%d\n", ans); return 0; }