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