Time Limit : sec, Memory Limit : KB
English / Japanese  

Geometric Data

In computer graphics, polygon models are used as a way to represent three-dimensional shapes. A polygon model is a model that creates a face by giving vertex coordinates and the way those vertices are connected.

Although general polygon models can handle arbitrary polygons, we will consider a polygon model consisting of triangles. An arbitrary polygon model can be represented as a collection of face information representing a triangle.

One face information is represented by three aligned vertices. However, if the three vertices are aligned differently, but consist of the same vertices, they will represent the same face information. For example, in the tetrahedron shown below, the face formed by connecting vertices 1, 2, 3 can be represented as vertices 2, 3, 1, vertices 3, 2, 1, and so on. In this way, it is better to combine the same face information into one, since multiple faces are useless.


Given the face information, make a program to find the number of face information that must be deleted to eliminate duplicate faces.

Input

The input is given in the following format.

N
p11 p12 p13
p21 p22 p23
:
pN1 pN2 pN3

In the first line, the number of face information of the polygon model N (1 ≤ N ≤ 1000) is given. In the following N lines, the vertex numbers pij (1 ≤ pij ≤ 1000) used to create the i -th face is given. However, the same vertex is never used more than once for a single face. (pi1pi2 and pi2pi3 and pi1pi3)

Output

Output the number of face information that must be deleted to eliminate duplicated faces in a line.

Sample Input 1

4
1 3 2
1 2 4
1 4 3
2 3 4 

Sample Output 1

0

Sample Input 2

6
1 3 2
1 2 4
1 4 3
2 3 4
3 2 1
2 3 1 

Sample Output 2

2

In Sample 2, the first, fifth, and sixth faces are duplicates. They are triangles consists of vertices 1, 3, 2, and the only difference is the order of the vertices. In other words, if we delete two of the duplicated faces, there will be no duplication.