#0005DF

O-duzi

You are given N segments in 3D space. Every segment is determined with two ending points. One point is represented with three integer coordinates in space.


How many different length appear in given set of segments? Length of one segment is:


Image: slika

InputIn first line of input is integer N, (N <= 5000) represents number of segments.
In next N lines are six integers (-1 000 000 000 <= X1, Y1, Z1, X2, Y2, Z2 <= 1 000 000 000) separated by empty space, coordinate of ending points of i-th segment.

OutputIn first line of output write one integer, number of different lengths in given set.


Input:
7
0 0 0 0 0 1
0 0 0 0 1 0
0 0 0 1 0 0
0 0 0 1 0 1
0 0 0 1 1 0
0 0 0 0 1 1
0 0 0 1 1 1

Output:
3


EXPLANATION: First three segments has length of 1, next three has length of square root of 2 and last one has length of square root of 3. Total of 3 different lengths.

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.