#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <stack>
#include <functional>
#include <queue>
#include <cmath>
#include <tuple>
#include <set>

#define rep(i,j,k) for(int i=j;i<k;i++)
#define all(v) (v).begin(),(v).end()
#define Sort(x) sort((x).begin(),(x).end())
#define fi first
#define se second
#define vi vector<int>
#define INF 1000000000
#define MOD 1000000007
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef std::pair<int,int> pii;
int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

using namespace std;



int main(){
    int n;
    cin>>n;
    set<ll> st;
    rep(i,0,n){
        ll a,b,c;
        cin>>a>>b>>c;
        st.insert(a*a*a+b*b*b+c*c*c);
    }
    cout<<n-st.size()<<endl;
    
    return 0;
}

