#include using namespace std; int main() { int n, k = 10; cin >> n; vector v(k, 0); for (int i = 0; i < n; i++) { int a, b, c; cin >> a >> b >> c; v[--a]++; v[--b]++; v[--c]++; } int ans = 0, res = 0; for (int i = 0; i < k; i++) { ans += v[i]/2; res += (v[i]&1); } cout << ans + res / 4 << endl; return 0; }