#include #define rep(i, a, n) for (int i = a; i < n; i++) #define repr(i, a, n) for (int i = n - 1; i >= a; i--) using namespace std; using ll = long long; using P = pair; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector v(11); rep(i, 0, n) { int a, b, c; cin >> a >> b >> c; v[a]++; v[b]++; v[c]++; } int ans = 0; rep(i, 1, 11) { if (v[i] >= 2) { ans += v[i] / 2; v[i] %= 2; } } int sum_val = 0; rep(i, 1, 11) { if (v[i] == 1) sum_val++; if (sum_val == 4) { ans++; sum_val = 0; } } cout << ans << endl; }