eolymp
bolt
Try our new interface for solving problems
Problems

Triangle

Triangle

Resting at the country house of Petya's grandmother, Peter and Bob decided to build a secret headquarters for his espionage organization. To accommodate all the spy equipment they need a room area of exactly s square meters. The headquarters walls were build of material, found in grandmother's shed. It was wood planks, each of length of exactly one meter. Choosing the form of a room, Bob remembered his last geometry lesson where he studied the right triangles. So he offered to build a headquarters in the form of this figure. And in this case they can easily calculate its area and make sure that it is required.

But it turned out that there is no saw, so its not possible to cut the boards. Vasya and Petya have to build a headquarters in the form of a right triangle, with all sides expressed in integer number of meters. He wondered how many such triangles exist. Triangles that have the same length of the sides, but differ by their order, are considered the same.

Input

One integer s (1s10000) - the required headquarters area.

Output

Print one integer - the number of different possible headquarters plans with the area of s square meters.

Time limit 1 second
Memory limit 128 MiB
Input example #1
1
Output example #1
0
Input example #2
6
Output example #2
1
Author Н.Ведерников, С.Поромов
Source 2011 Четвертая олимпиада, Базовый уровень, 12 ноября