#include<iostream>
#include<algorithm>
using namespace std;
int n,ans;
class men{
	public:
	int a,b,c;
	men(int aa,int bb,int cc){
		a=aa;
		b=bb;
		c=cc;
	}
	men(){
	a=0;
	b=0;
	c=0;
	}
};

men table[1000];

int main(){

	cin>>n;
	for(int i=0;i<n;i++){
		int a,b,c;
		cin>>a>>b>>c;
		if(a<b)swap(a,b);
		if(a<c)swap(a,c);
		if(b<c)swap(b,c);
		men tmp;
		tmp.a=a;
		tmp.b=b;
		tmp.c=c;
		table[i]=tmp;			
	}	
	
	for(int i=0;i<n;i++){
		int ta,tb,tc;
		ta=table[i].a;
		tb=table[i].b;
		tc=table[i].c;
		
		for(int j=i+1;j<n;j++){
			if(table[j].a==-1||table[j].b==-1||table[j].c==-1)continue;
			if(ta==table[j].a&&tb==table[j].b&&tc==table[j].c){
				ans++;
				table[j].a=-1;
				table[j].b=-1;
				table[j].c=-1;
			}
		}
	}
	cout<<ans<<endl;
	
}