Squares and Cubes#10995

Squares and Cubes

1 second
128 megabytes
Medium

List all perfect squares and perfect cubes of positive integers in a sequence: 1, 4, 8, 9, ....

For a given value , determine how many numbers from to appear in this list.

In other words, find how many numbers satisfy the condition that is either a square or a cube of a positive integer (including those that are both square and cube at the same time).

Input

The first line contains the number of test cases .

Each of the following lines contains a single positive integer n~(1 \le n \le 10^9).

Output

For each test case, print on a separate line the number of integers from to that are perfect squares or perfect cubes of positive integers.

Examples

Example 1

Loading
Loading