AlgoUniversity
  • Go Back
Discussion
Magic Number :

Author

Akshay Sharma

Difficulty Level : Easy

Submissions : 94

Asked In : Tech-Mahindra

Marks :100

: 2 | : 0

Amit is fond of Magic number. one day he is planning a trip from City A to B where there is exactly N rest point between both the cities and every rest point have an ID(Not necessary unique), Amit stop only those rest point whose ID(Hotel ID) is a magic number. if there is no rest point whose ID is a magic number then Amit didn't stop at any such points and reached city B directly. Now before planning the trip Amit wants to know In how many rest points he can stop his car and have some rest.

Note: According to Amit magic number is a number which is a perfect Square of any number eg:0,1,4,9....N

Input

The first line of the test case contains a single integer N ($$$0 \le N, M \le 10^6$$$) — the number of rest points from city A to B.

The second line of each test case contains N integers $$$a_i$$$, $$$a_{i+1}$$$ ..... $$$a_{n-1}$$$ ($$$0 \le a_i \le 10^6$$$) — the ID of each rest point or hotel number .

Output

For each test case, print one integer on a single line — the count of total numbers magic number that Amit has.

Examples

Input
5
25 77 54 81 48 
Output
2
Input
10
0 3 5 10 15 16 18 19 200 625
Output
3

You need to login to view your submissions.

You need to login to view all submissions.

Loading...

Result : Executed

Loading...

Feel something is wrong with the test cases?

Result : Accepted

Test Cases :

You need to Log In
We're glad that you want to attempt this problem!

But to Run or Submit the Problem, you need to Log In.

Continue to Log In
Challenge Submitted!

Your challenge has been submitted successfully.

You will get a response soon via WhatsApp or Email.

Challenge
Facing issue while trying to solve the problem! Don't worry, we got you covered!

Do let us know your issue.

Looks good!
Please enter your issue / feedback.

How do we get in touch with you?
Looks good!
Please enter your phone no.
Looks good!
Please enter your email address.