
Fax McClad, Croneria's most observant bounty hunter, is out stargazing with his wingmate Flaco.
Using purely his keen eyesight, Fax collects data about the countless planets in the sky. The sky can be represented as a 2D Cartesian plane, where each planet can only occupy a single point. No two planets will be located at the same point.
To begin, Fax records an arbitrary first planet. He does not know the exact position of this planet. He then picks another planet and records its difference in position relative to a previously recorded planet, repeating this process until ultimately, all planets have been picked. Occasionally, Fax may accidentally pick a new planet that has already been previously picked.
Given Fax's data, can you help him determine the number of distinct planets in the sky? That is, how many distinct locations of planets will Fax have recorded?
Input Specification
The first line contains integer
Note that this includes the first planet.
The following
For the
Note that the difference between two values is calculated by the final value subtracting the initial value.
Output Specification
A single integer, the number of distinct planets in the sky.
Sample Input
5
1 7 8
2 3 2
1 10 10
4 -5 -5
Sample Output
4
Explanation
Fax initially picks a first planet (that is not reflected in the input).
The second picked planet is located at
The third picked planet is located at
However, the fourth picked planet is also located at
The fifth picked planet is located at
In total, there are
Comments