#92Medium
Perfect squares
Time: 1 s · Memory: 256 MB
- Functions
Statement
Write a function IsSquare(k) that returns true if a non-negative integer is the square of an integer and false otherwise. Using it, count how many of the given numbers are perfect squares. is a perfect square too.
Input format
The first line contains (). The second line contains integers ().
Output format
A single integer — the number of perfect squares.
Examples
Input
10 1 2 3 4 5 6 7 8 9 10
Output
3
Input
4 0 15 16 17
Output
2
Note
Do not compare the root as a floating-point number: sqrt(x) == floor(sqrt(x)) is wrong around — in a double the root of comes out as exactly , so the number looks like a square. Convert the root to an integer and check : (in Python — ).
