Problem: You are given n triangles. 

You are required to find how many triangles are unique out of given triangles.
For each triangle you are given three integers a,b,c , the sides of a
triangle.

A triangle is said to be unique if there is no other triangle with same set of sides.

Note : It is always possible to form triangle with given sides.

INPUT:

First line contains n, the number of triangles. Each of next n lines contain
three integers a,b,c (sides of a triangle).

Output:

print single integer, the number of unique triangles.

Constraints:

1 ≤ n ≤ 10^5
1 ≤ a,b,c ≤ 10^15

SAMPLE INPUT
5
7 6 5
5 7 6
8 2 9
2 3 4
2 4 3 

SAMPLE OUTPUT
1

Explanation

only triangle with sides 8, 2, 9 is unique

Solution (in PYTHON):

Solution:
'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''

def make_comparator(less_than):
  def compare(x, y):
      if less_than(x[0], y[0]):
          return -1
      elif less_than(y[0], x[0]):
          return 1
      else:
          if less_than(x[1], y[1]):
            return -1
          elif less_than(y[1], x[1]):
            return 1
          else:
            if less_than(x[2], y[2]):
              return -1
            elif less_than(y[2], x[2]):
              return 1
            else: return 0
  return compare

cmpValue = lambda x,y:  x<y

total = int(raw_input())
all_triangles = [];
for i in range(total):
  next_tr = [int(x) for x in raw_input().split(" ")]
  all_triangles.append( sorted(next_tr) );
  
all_triangles = sorted(all_triangles, cmp=make_comparator(cmpValue))
count = 0
current_count = 0
# print all_triangles
# prev = all_triangles[0]
# next_tr = all_triangles[1]
# print prev, next_tr

# print all_triangles
# print  not (prev[0] == next_tr[0] and prev[1] == next_tr[1] and prev[2] == next_tr[2])
for i in range(0,total-1):
  prev = all_triangles[i]
  next_tr = all_triangles[i+1]
  if(prev[0] == next_tr[0] and prev[1] == next_tr[1] and prev[2] == next_tr[2]):
    current_count += 1
    # print prev, next
  else:
    if current_count > 0:
      current_count = 0
      pass
    else: 
      count += 1
      current_count = 0
  # print count, current_count
  prev = next_tr

prev = all_triangles[total-2]
next_tr = all_triangles[total-1]

if(prev[0] == next_tr[0] and prev[1] == next_tr[1] and prev[2] == next_tr[2]):
  pass
else: count += 1


  
print count