Itsy went for a walk and found several sticks in the park. She is wondering how many of these sticks can she use to make right angled triangles.
The sticks are all straight and of integer lengths. Yes, amazing things happen in the world of problem solving if you want to believe it.
You will be given the lengths of the sticks.
You will have to determine the number of sticks from which you can take three sticks at a time to make a right angled triangle.
A right angled triangle has one angle that is .
You can reuse the same stick in different triangles, but you will count the stick only once in your result.
The first line contains an integer (). is the number of sticks Itsy has collected.
The following line contains integers. Each of these integers, (), represents the length of a stick that Itsy has collected.
Print the number of sticks Itsy can use to make right-angled triangles.
Input | Output |
---|---|
5 2 3 4 3 5 | 4 |