#include #define rep(i,a,n) for (int i = a;i < n;i++) using namespace std; #define MAX 11 int dp[MAX]; int main(){ int n; cin >> n; rep(i,0,n){ int a,b,c; cin >> a >> b >> c; dp[a]++;dp[b]++;dp[c]++; } int ans = 0; int tmp = 0; rep(i,0,MAX){ ans += dp[i] / 2; tmp += dp[i] % 2; } ans += tmp / 4; cout << ans << endl; }