Triangle#4086

Triangle

5 seconds
64 megabytes
Very hard

A talented student, inspired by the Pythagorean theorem, drew right-angled triangles on the board before the next class. At the beginning of the lesson, the teacher measured the sides of these triangles using a wooden ruler, rounding each measurement to the nearest whole centimeter, and noted these numbers down in a notebook. Then, after covering the board, the teacher read out these recorded numbers in a random order and challenged the class to determine how many right-angled triangles the "Pythagorean student" had actually drawn.

Input

The input file starts with the number (3 \leq N \leq 100) on the first line, followed by 3\cdot N lines, each containing a single natural number (a \leq 2147483647).

Output

The output file should contain a single line with the integer — the maximum number of right-angled triangles that can be formed from the given side lengths.

Examples

Example 1

Loading
Loading