Description

There are n bulbs initially off. For round i, you toggle every ith bulb. After n rounds, how many bulbs are on? Return the result as an integer.

Examples

Input:n = 3
Output:1
Explanation:

Only bulb 1 remains on.

Input:n = 0
Output:0
Explanation:

With 0 bulbs, there are no bulbs to toggle, so 0 bulbs remain on.

Input:n = 1
Output:1
Explanation:

With 1 bulb, round 1 toggles it ON. Only bulb 1 remains on (perfect square positions stay on).

Constraints

  • 0 ≤ n ≤ 10⁹

Ready to solve this problem?

Practice solo or challenge other developers in a real-time coding battle!