There are N tanks in the Battlefield. They need to connect to each other, so that they can report the enemy to every other tank. More formally every tank should be able to communicate to every other tank.(maybe through some other tank)
For the communication to be possible,some links are to be made among the tanks. Cost of creating a link between two tanks A and B is equal to the distance between them. The total cost required for connections should be MINIMUM.
The tanks move with constant linear velocity in some direction. So, after some time we might want to switch some of our connections to reduce the cost of connections. But, this switching of connections is very costly, So we want to find how many times we will have to perform such a switch.
Note: If the connections are optimal at time t, then connections will also be optimal to t<s<t+10-6.
INPUT:
First line contains N.
Each of the next N lines contain 6 integers, X,Y,Z,Vx,Vy,Vz. X,Y,Z denotes the initial position of the tank, and Vx,Vy,Vz.denotes the x,y and z components of the velocity.
OUTPUT:
Output a single line containing a single integer, denting the number of times the connections will be switched.
CONSTRAINTS:
2<=N<=50
-150<=X,Y,Z<=150
-100<=Vx,Vy,Vz<=100