#include #define F(i,n) for(int i = 0;i < n;i++) int main (void){int l,m,n;int it[11]={0};int a[300];scanf("%d",&n);F(i,n*3)scanf("%d",&a[i]);F(i,n*3){F(i2,10){if(a[i]==i2+1)it[i2+1]++;}}F(i,11){l += it[i]/2;it[i]=it[i]%2;}m=0;F(i,11) m= m+ it[i];l=l+m/4;printf("%d\n",l);return(0);}