Polycarp likes squares and cubes of positive integers. Here is the beginning of the sequence of numbers he likes: $1$, $4$, $8$, $9$, ....

For a given number $n$, count the number of integers from $1$ to $n$ that Polycarp likes. In other words, find the number of such $x$ that $x$ is a square of a positive integer number or a cube of a positive integer number (or both a square and a cube simultaneously).


-----Input-----

The first line contains an integer $t$ ($1 \le t \le 20$) — the number of test cases.

Then $t$ lines contain the test cases, one per line. Each of the lines contains one integer $n$ ($1 \le n \le 10^9$).


-----Output-----

For each test case, print the answer you are looking for — the number of integers from $1$ to $n$ that Polycarp likes.


-----Examples-----

Input
6
10
1
25
1000000000
999999999
500000000
Output
4
1
6
32591
32590
23125


-----Note-----

None

Source: codeforces | Difficulty: EASY
Tags: Mathematics

Implementation


Solutions:
for s in [*open(0)][1:]:
	n = int(s) + 0.5
	print(int(n ** 0.5) + int(n ** (1 / 3)) - int(n ** (1 / 6)))


for _ in range(int(input())):
	n = int(input())
	a = 1
	b = 1
	c = 1
	ans = 0
	while a ** 2 <= n:
		ans += 1
		a += 1
	while b ** 3 <= n:
		ans += 1
		b += 1
	while c ** 6 <= n:
		ans -= 1
		c += 1
	print(ans)


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
import string
ORDA = 97

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=2):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	new_number = 0
	while number > 0:
		new_number += number % base
		number //= base
	return new_number

def cdiv(n, k):
	return n // k + (n % k != 0)

def ispal(s):
	for i in range(len(s) // 2 + 1):
		if s[i] != s[-i - 1]:
			return False
	return True
for _ in range(ii()):
	n = ii()
	ans = 0
	i = 1
	while i ** 2 <= n:
		ans += 1
		i += 1
	i = 1
	while i ** 3 <= n:
		ans += 1
		i += 1
	i = 1
	while i ** 6 <= n:
		ans -= 1
		i += 1
	print(ans)


for _ in range(int(input())):
	n = int(input())
	n += 0.5
	t1 = int(n ** (1 / 2))
	t2 = int(n ** (1 / 3))
	t3 = int(n ** (1 / 6))
	print(t1 + t2 - t3)


for _ in range(int(input())):
	n = int(input()) + 0.5
	print(int(n ** (1 / 2)) + int(n ** (1 / 3)) - int(n ** (1 / 6)))


for _ in range(int(input())):
	initialinput = int(input())
	nums = []
	cbn = 1
	sqrn = 2
	while cbn ** 3 <= initialinput:
		nums.append(cbn ** 3)
		cbn += 1
	while sqrn ** 2 <= initialinput:
		nums.append(sqrn ** 2)
		sqrn += 1
	print(len(set(nums)))


def solve():
	n = int(input())
	seen = set()
	for i in range(1, n + 1):
		d = i * i
		if d > n:
			break
		seen.add(d)
	for i in range(1, n + 1):
		d = i * i * i
		if d > n:
			break
		seen.add(d)
	print(len(seen))
t = int(input())
for _ in range(t):
	solve()


t = int(input())
for _ in range(t):
	n = int(input())
	seen = set()
	for i in range(1, 10 ** 5):
		val = i ** 2
		if val > n:
			break
		seen.add(val)
	for i in range(1, 10 ** 3 + 2):
		val = i ** 3
		if val > n:
			break
		seen.add(val)
	print(len(seen))


from math import isqrt
t = int(input())
while t:
	t -= 1
	n = int(input())
	print(isqrt(n) + int(round(pow(n, 1 / 3), 12)) - int(round(pow(isqrt(n), 1 / 3), 12)))


for i in range(int(input())):
	n = int(input())
	n = n + 0.99
	a = int(n ** (1 / 2))
	b = int(n ** (1 / 3))
	c = int(n ** (1 / 6))
	print(a + b - c)


t = int(input())
for i in range(t):
	n = int(input())
	c2 = 0
	c3 = 0
	c6 = 0
	for j in range(1, int(n ** 0.5) + 1):
		if j ** 2 <= n:
			c2 += 1
	for j in range(1, int(n ** (1 / 3)) + 2):
		if j ** 3 <= n:
			c3 += 1
	for j in range(1, int(n ** (1 / 6)) + 2):
		if j ** 6 <= n:
			c6 += 1
	print(c2 + c3 - c6)


a = int(input())
kvadrat = 1
sp1 = set()
kub = 1
for i in range(a):
	kvadrat = 1
	kub = 1
	sp1.clear()
	sp1 = set()
	n = int(input())
	while kvadrat ** 2 <= n:
		sp1.add(kvadrat ** 2)
		kvadrat += 1
	while kub ** 3 <= n:
		sp1.add(kub ** 3)
		kub += 1
	print(len(sp1))
	sp1.clear()


import math
for i in range(int(input())):
	a = int(input())
	s = []
	t = 1
	po = 1
	while t <= a ** (1.0 / 2) + 1e-08:
		s.append(t ** 2)
		t = t + 1
	while po <= a ** (1.0 / 3) + 1e-08:
		s.append(po ** 3)
		po = po + 1
	s = list(dict.fromkeys(s))
	s.sort()
	print(len(s))


def run(contest=False):
	if not contest:
		import sys
		sys.stdin = open('input')
	for _ in range(int(input())):
		n = int(input())
		use = 1
		counter = 0
		hash = {}
		while True:
			if use ** 2 <= n and use ** 2 not in hash:
				counter += 1
				hash[use ** 2] = None
			if use ** 3 <= n and use ** 3 not in hash:
				counter += 1
				hash[use ** 3] = None
			if use ** 2 > n:
				break
			use += 1
		print(counter)
run(1)


import math

def solve(num):
	square = int(math.pow(num, 1 / 2) + 1e-10)
	cube = int(math.pow(num, 1 / 3) + 1e-10)
	sixth = int(math.pow(num, 1 / 6) + 1e-10)
	return square + cube - sixth
t = int(input())
for i in range(t):
	n = int(input())
	print(solve(n))


import math
t = int(input())
mass = []
for i in range(t):
	x = int(input())
	kol_kv = int(math.sqrt(x))
	kol_kub = int(x ** (1 / 3))
	kol_sh = int(x ** (1 / 6))
	if round(x ** (1 / 3)) ** 3 == x and round(x ** (1 / 3)) != int(x ** (1 / 3)):
		kol_kub += 1
	if round(x ** (1 / 6)) ** 6 == x and round(x ** (1 / 6)) != int(x ** (1 / 6)):
		kol_sh += 1
	if round(math.sqrt(x)) ** 2 == x and round(math.sqrt(x)) != int(math.sqrt(x)):
		kol_kv += 1
	print(kol_kub + kol_kv - kol_sh)


def getPow(data, a):
	left = 0
	right = data
	while left <= right:
		mid = (left + right) // 2
		if mid ** a < data:
			left = mid + 1
		elif mid ** a == data:
			return mid
		else:
			right = mid - 1
	return left - 1

def tack():
	data = int(input())
	squ = getPow(data, 2)
	cube = getPow(data, 3)
	six = getPow(data, 6)
	ans = squ + cube - six
	print(ans)

def main():
	n = int(input())
	for x in range(n):
		tack()
main()


for iq in range(int(input())):
	n = int(input())
	kv = 1
	ku = 1
	si = 1
	while kv * kv <= n:
		kv += 1
	while ku * ku * ku <= n:
		ku += 1
	while si * si * si * si * si * si <= n:
		si += 1
	print(kv - 1 + ku - si)


from decimal import *
getcontext().prec = 13
for _ in range(int(input())):
	n = int(input())
	print(int(Decimal(n) ** Decimal(0.5)) + int(Decimal(n) ** Decimal(1 / 3)) - int(Decimal(n) ** Decimal(1 / 6)))


a = int(input())
for _ in range(a):
	s = int(input())
	h = set()
	i = f = 1
	h.add(i)
	while f <= s:
		i += 1
		f = i ** 2
		if f <= s:
			h.add(f)
	i = f = 1
	while f <= s:
		i += 1
		f = i ** 3
		if f <= s:
			h.add(f)
	print(len(h))


import os
import sys
from io import BytesIO, IOBase
import math as M
import itertools as ITR
from collections import defaultdict as D
from collections import Counter as C
from collections import deque as Q
import threading
from functools import cmp_to_key, lru_cache, reduce
from functools import cmp_to_key as CMP
from bisect import bisect, bisect_left as BL
from bisect import bisect_right as BR
import random as R
import string
import cmath, time
from heapq import heapify, heappop as HPOP
from heapq import heappush as HPUSH
import heapq as H
enum = enumerate
start_time = time.time()
MOD = 1000000007
MA = float('inf')
MI = float('-inf')
d8i = (-1, -1, 0, 1, 1, 1, 0, -1)
d8j = (0, 1, 1, 1, 0, -1, -1, -1)
d4i = (-1, 0, 1, 0)
d4j = (0, 1, 0, -1)

def increase_stack():
	sys.setrecursionlimit(2 ** 32 // 2 - 1)
	threading.stack_size(1 << 27)

def binary(n):
	return bin(n)[2:]

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def maxfactor(n):
	q = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			q.append(i)
	if q:
		return q[-1]

def factors(n):
	q = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			q.append(i)
			q.append(n // i)
	return list(sorted(list(set(q))))

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(M.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n / i
	if n > 2:
		l.append(int(n))
	l.sort()
	return l

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def seive(n):
	a = []
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p ** 2, n + 1, p):
				prime[i] = False
		p = p + 1
	for p in range(2, n + 1):
		if prime[p]:
			a.append(p)
	prime[0] = prime[1] = False
	return (a, prime)

def maxPrimeFactors(n):
	maxPrime = -1
	while n % 2 == 0:
		maxPrime = 2
		n >>= 1
	for i in range(3, int(M.sqrt(n)) + 1, 2):
		while n % i == 0:
			maxPrime = i
			n = n / i
	if n > 2:
		maxPrime = n
	return int(maxPrime)

def countchar(s, i):
	c = 0
	ch = s[i]
	for i in range(i, len(s)):
		if s[i] == ch:
			c += 1
		else:
			break
	return c

def str_counter(a):
	q = [0] * 26
	for i in range(len(a)):
		q[ord(a[i]) - 97] = q[ord(a[i]) - 97] + 1
	return q

def lis(arr):
	n = len(arr)
	lis = [1] * n
	maximum = 0
	for i in range(1, n):
		for j in range(0, i):
			if arr[i] > arr[j] and lis[i] < lis[j] + 1:
				lis[i] = lis[j] + 1
				maximum = max(maximum, lis[i])
	return maximum

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)

def agcd(a):
	(a, b) = (a[0], a[1:])
	for i in b:
		a = gcd(a, i)
	return a

def lcm(a, *b):
	val = a
	gc = a
	for i in b:
		gc = gcd(gc, i)
		val *= i
	return val // gc

def ncr(n, r):
	return M.factorial(n) // (M.factorial(n - r) * M.factorial(r))

def npr(n, r):
	return M.factorial(n) // M.factorial(n - r)

def IF(c, t, f):
	return t if c else f

def YES(c):
	print(IF(c, 'YES', 'NO'))

def Yes(c):
	print(IF(c, 'Yes', 'No'))

def yes(c):
	print(IF(c, 'yes', 'no'))

def JA(a, sep=' '):
	print(sep.join(map(str, a)))

def JAA(a, s='\n', t=' '):
	print(s.join((t.join(map(str, b)) for b in a)))

def PS(a, s=' '):
	print(str(a), end=s)

def I():
	return int(inp())

def F():
	return float(inp())

def LI():
	return list(map(int, inp().split()))

def LF():
	return list(map(float, inp().split()))

def MATI(n):
	return [LI() for i in range(n)]

def MATS(n):
	return [list(inp()) for i in range(n)]

def IV():
	return map(int, inp().split())

def FV():
	return map(float, inp().split())

def LS():
	return list(inp())

def S():
	return inp()
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
inp = lambda : sys.stdin.readline().rstrip('\r\n')
TestCases = 0

def solve(test_no):
	n = I()
	darr = []
	tarr = []
	c = 1
	while 1:
		if c * c > MOD:
			break
		darr.append(c * c)
		c += 1
	c = 2
	while 1:
		if c * c * c > MOD:
			break
		tarr.append(c * c * c)
		c += 1
	arr = []
	p = len(darr)
	q = len(tarr)
	i = j = 0
	while i < p and j < q:
		if darr[i] < tarr[j]:
			arr.append(darr[i])
			i += 1
		elif darr[i] == tarr[j]:
			arr.append(darr[i])
			i += 1
			j += 1
		else:
			arr.append(tarr[j])
			j += 1
	while i < p:
		arr.append(darr[i])
		i += 1
	while j < q:
		arr.append(tarr[j])
		j += 1
	for i in range(n):
		ele = I()
		val = BR(arr, ele)
		print(val)

def main():
	flag = 1
	try:
		sys.stdin = open('C:/Users/raavi.manoj/Documents/coding/python/input.txt', 'r')
		sys.stdout = open('C:/Users/raavi.manoj/Documents/coding/python/output.txt', 'w')
	except:
		flag = 0
	t = 1
	if TestCases:
		t = I()
	for test in range(1, t + 1):
		solve(test)
	if flag:
		print('\nTHIS IS A PYTHON OUTPUT FILE')
		print('Time: %.4f seconds' % (time.time() - start_time))
		localtime = time.asctime(time.localtime(time.time()))
		print(localtime)
		sys.stdout.close()
main()


for _ in range(int(input())):
	n = int(input()) + 0.01
	ans = int(n ** (1 / 2)) + int(n ** (1 / 3)) - int(n ** (1 / 6))
	print(ans)


for n in [*map(int, open(0))][1:]:
	n += 0.5
	print(int(n ** 0.5) + int(n ** (1 / 3)) - int(n ** (1 / 6)))


t = int(input())
for i in range(t):
	digit = int(input())
	sqrt3 = round(digit ** (1.0 / 3.0))
	if sqrt3 ** 3 > digit:
		sqrt3 -= 1
	print(int(digit ** 0.5 // 1 + (sqrt3 - sqrt3 ** 0.5 // 1)))


from math import *
eps = 1e-08
t = int(input())
for _ in range(t):
	n = int(input())
	m = int(n ** 0.5)
	i = 2
	while 1:
		j = i ** 3
		i += 1
		if j > n:
			break
		if j ** 0.5 != int(j ** 0.5):
			m += 1
	print(m)
	print()


from bisect import bisect_right
a = []
(i, j) = (1, 1)
while i ** 2 <= 10 ** 10 and j ** 3 <= 10 ** 10:
	if i ** 2 < j ** 3:
		a.append(i ** 2)
		i += 1
	elif i ** 2 > j ** 3:
		a.append(j ** 3)
		j += 1
	else:
		a.append(j ** 3)
		(i, j) = (i + 1, j + 1)
for _ in range(int(input())):
	n = int(input())
	print(bisect_right(a, n))


def sq_cub(n):
	store = set()
	x = int(n ** (1 / 2))
	for i in range(1, x + 1):
		square = i ** 2
		if square <= n:
			store.add(square)
	for i in range(1, x + 1):
		cube = i ** 3
		if cube <= n:
			store.add(cube)
	return len(store)
t = int(input())
while t > 0:
	y = int(input())
	print(sq_cub(y))
	t -= 1


import math
for i in range(int(input())):
	n = int(input())
	n += 0.0001
	t = int(n ** 0.5)
	v = math.ceil(n ** (1 / 3))
	r = int(n ** 0.5)
	print(int(n ** 0.5 + int(n ** (1 / 3)) - int(n ** (1 / 6))))


import math
for _ in range(int(input())):
	n = int(input())
	two = math.sqrt(n)
	three = n ** (1.0 / 3)
	six = n ** (1.0 / 6)
	two = int(round(two, 9))
	three = int(round(three, 9))
	six = int(round(six, 9))
	print(int(two + three - six))


n = int(input())
for i in range(n):
	x = int(input()) + 0.5
	print(int(x ** (1 / 2)) + int(x ** (1 / 3)) - int(x ** (1 / 6)))


t = int(input())
for _ in range(t):
	n = int(input())
	a = int(n ** 0.5)
	b = int(n ** 0.3333333333334)
	c = int(n ** 0.1666666666667)
	print(a + b - c)


def solve(n):
	(sq, cub) = (1, 0)
	(sl, sr) = (1, n)
	while sl < sr:
		m = (sl + sr + 1) // 2
		if m * m <= n:
			sl = m
		else:
			sr = m - 1
	sq = sl
	(sl, sr) = (1, n)
	while sl < sr:
		m = (sl + sr + 1) // 2
		if m * m * m <= n:
			sl = m
		else:
			sr = m - 1
	sq += sl
	(sl, sr) = (1, n)
	while sl < sr:
		m = (sl + sr + 1) // 2
		if m ** 6 <= n:
			sl = m
		else:
			sr = m - 1
	sq -= sl
	return sq
t = int(input())
for _ in range(t):
	n = int(input())
	print(solve(n))


from math import sqrt

def check(x):
	rt1 = int(round(x ** (1.0 / 3)))
	rt2 = int(round(x ** (1.0 / 2)))
	if rt1 ** 3 == x and rt2 ** 2 == x:
		return True
	return False
for _ in range(int(input())):
	N = int(input())
	ans = 0
	for i in range(1, int(sqrt(N)) + 4):
		if i * i <= N:
			ans += 1
		if i * i * i <= N:
			ans += 1
		if i * i * i <= N and check(i * i * i):
			ans -= 1
	print(ans)


import bisect
X = [1]
for i in range(40000):
	for j in range(2, 4):
		if i ** j > 10 ** 9:
			break
		X.append(i ** j)
X = list(set(X))
X.sort()
t = int(input())
for i in range(t):
	A = int(input())
	c = bisect.bisect_right(X, A)
	print(c - 1)


from bisect import bisect_right
all_numbers = set()
x = 1
while x * x <= 10 ** 9 + 1:
	all_numbers.add(x * x)
	x += 1
x = 1
while x * x * x <= 10 ** 9 + 1:
	all_numbers.add(x * x * x)
	x += 1
all_numbers = sorted(list(all_numbers))
for _ in range(int(input())):
	n = int(input())
	print(bisect_right(all_numbers, n))


import math

def duplicateCubes():
	list1 = [0] * 1002
	count = 0
	for i in range(1, 1001):
		num = i ** 3
		num = math.sqrt(num)
		num = num - int(num)
		if num == 0:
			count += 1
		list1[i + 1] = count
	return list1

def Calc(n, list1):
	sr = int(math.sqrt(n))
	cr = int(n ** (1 / 3) + 1e-07)
	count = list1[cr + 1]
	result = sr + cr - count
	return result
t = int(input())
array = duplicateCubes()
for i in range(t):
	n = int(input())
	result = Calc(n, array)
	print(result)


import math
res = []
ct = 0

def int_cube_root(x):
	if x >= 0:
		sign = 1
	else:
		x = -x
		sign = -1
	(a, b) = (0, x)
	while a <= b:
		m = (a + b) // 2
		m3 = m * m * m
		if m3 == x:
			return sign * m
		elif m3 < x:
			a = m + 1
		else:
			b = m - 1
	return sign * b
for _ in range(int(input())):
	n = int(input())
	cbrt = int_cube_root(n)
	srt = math.sqrt(n)
	a = math.sqrt(cbrt)
	ct = int(srt) + cbrt - int(a)
	res.append(ct)
	ct = 0
for i in range(len(res)):
	print(res[i])


from sys import stdin
import math
from collections import deque
from heapq import heapify, heappop, heappush
from bisect import bisect_left, bisect_right
input = stdin.readline

def log(n, m):
	(res, val) = (0, 1)
	while True:
		if n == val:
			return res
		elif n > val:
			return res - 1
		res += 1
		val *= m

def ceil(m, n):
	val = m // n
	if m % n != 0:
		return val + 1
	return val

def square(a, p, low, high):
	while low < high:
		mid = (low + high) // 2
		val = mid ** p
		if a > val:
			low = mid + 1
		elif a == val:
			return mid
		else:
			high = mid
	if low ** p > a:
		return low - 1
	else:
		return low
for _ in range(int(input())):
	val = int(input())
	power2 = square(val, 2, 1, 10 ** 5)
	power3 = square(val, 3, 1, 10 ** 3 + 1)
	power6 = square(val, 6, 1, 100)
	print(power2 + power3 - power6)


import sys, array, bisect, collections, heapq, itertools, math, functools
sys.setrecursionlimit(100000)

def _r():
	return sys.stdin.buffer.readline()

def rs():
	return _r().decode('ascii').strip()

def rn():
	return int(_r())

def rnt():
	return tuple(map(int, _r().split()))

def rnl():
	return list(rnt())

def rna():
	return array.array('q', rnt())

def pnl(l):
	print(' '.join(map(str, l)))

def solve(n):
	sol = 0
	s = 1
	while s ** 2 <= n:
		sol += 1
		s += 1
	q = 1
	while q ** 3 <= n:
		sq = int(math.sqrt(q ** 3))
		if sq ** 2 != q ** 3:
			sol += 1
		q += 1
	return sol
for _ in range(rn()):
	print(solve(rn()))


n = int(input())
for i in range(n):
	x = int(input())
	sq = int(x ** (1 / 2) + 1e-10)
	cub = int(x ** (1 / 3) + 1e-10)
	sc = int(x ** (1 / 6) + 1e-10)
	print(sq + cub - sc)


from math import ceil, log2, floor, sqrt, gcd
from collections import defaultdict, deque
from bisect import bisect_left
import sys
import os.path
from itertools import permutations
sys.setrecursionlimit(200000)
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r+')
	sys.stdout = open('output.txt', 'w')

def MI():
	return map(int, input().split())
mod = 10 ** 9 + 7

def solve(testcase):
	n = int(input())
	ans = 0
	d = defaultdict(bool)
	for i in range(1, int(n ** (1 / 2)) + 1):
		a = i ** 2
		b = i ** 3
		if d[a] == False and a <= n:
			ans += 1
			d[a] = True
		if d[b] == False and b <= n:
			ans += 1
			d[b] = True
	print(ans)
t = int(input())
for _ in range(t):
	solve(_ + 1)


import math

def check(n):
	if str(n).split('.')[1][:4] == '9999':
		return int(n) + 1
	else:
		return int(n)
for _ in range(int(input())):
	n = int(input())
	itwo = 0
	ithree = 0
	isix = 0
	true = True
	while true:
		if itwo * itwo > n:
			itwo -= 1
			break
		itwo += 1
	while true:
		if ithree * ithree * ithree > n:
			ithree -= 1
			break
		ithree += 1
	while true:
		if isix * isix * isix * isix * isix * isix > n:
			isix -= 1
			break
		isix += 1
	print(itwo + ithree - isix)


t = int(input())
import math
while t != 0:
	n = int(input())
	sq = int(math.sqrt(n))
	cub = int(math.pow(n, 1 / 3))
	if (cub + 1) * (cub + 1) * (cub + 1) == n:
		cub += 1
	if cub == 0:
		temp = 0
	else:
		temp = int(math.sqrt(cub))
	c = cub
	print(sq + cub - temp)
	t -= 1


import heapq
import sys
from math import *
import threading
from heapq import *
from itertools import count
from pprint import pprint
from collections import defaultdict
from heapq import heapify, heappop, heappush
mod = 10 ** 9 + 7
inf = 10 ** 15
decision = ['NO', 'YES']
yes = 'YES'
no = 'NO'
import os
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

	def npr(self, n, k):
		if k < 0 or n < k:
			return 0
		f = self.factorial
		return f.calc(n) * f.invFactorial(n - k) % self.MOD

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: max(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

def lower_bound(li, num):
	answer = len(li)
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = len(li)
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			start = middle + 1
		else:
			answer = middle
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val):
	ans = -1
	lb = 0
	ub = len(li) - 1
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = mid
			break
	return ans

def kadane(x):
	sum_so_far = 0
	current_sum = 0
	for i in x:
		current_sum += i
		if current_sum < 0:
			current_sum = 0
		else:
			sum_so_far = max(sum_so_far, current_sum)
	return sum_so_far

def pref(li):
	pref_sum = [li[0]]
	for i in range(1, len(li)):
		pref_sum.append(pref_sum[-1] + i)
	return pref_sum

def SieveOfEratosthenes(n):
	prime = [{1, i} for i in range(n + 1)]
	p = 2
	while p <= n:
		for i in range(p * 2, n + 1, p):
			prime[i].add(p)
		p += 1
	return prime

def primefactors(n):
	factors = []
	while n % 2 == 0:
		factors.append(2)
		n //= 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			factors.append(i)
			n //= i
	if n > 2:
		factors.append(n)
	return factors

def prod(li):
	ans = 1
	for i in li:
		ans *= i
	return ans

def given():
	a = list(map(int, input().split()))
	return a

def givenStringList():
	s = list(input())
	return s

def givenStringListInt():
	s = [int(x) for x in givenStringList()]
	return s

def main():
	karmanya = given()[0]
	while karmanya != 0:
		karmanya -= 1
		a = int(input())
		i = 1
		s = set()
		while i ** 2 <= a:
			s.add(i ** 2)
			i += 1
		i = 1
		while i ** 3 <= a:
			s.add(i ** 3)
			i += 1
		print(len(s))
main()


import math
T = int(input())
for t in range(T):
	n = int(input())
	sq = int(math.sqrt(n))
	cb = int(n ** (1 / 3))
	sqcb = int(n ** (1 / 6))
	if (sq + 1) ** 2 == n:
		sq += 1
	if (cb + 1) ** 3 == n:
		cb += 1
	if (sqcb + 1) ** 6 == n:
		sqcb += 1
	print(sq + cb - sqcb)


n = int(input())
for _ in range(n):
	m = int(input())
	ans = set()
	ans.add(1)
	k = 2
	cube = True
	while k <= m ** (1 / 2):
		if k ** 3 <= m:
			ans.add(k ** 3)
			ans.add(k ** 2)
		elif k ** 2 <= m:
			ans.add(k ** 2)
		k += 1
	print(len(ans))


def temp(a, b):
	counter = 1
	while counter ** a <= b:
		counter += 1
	return counter - 1

def b(n):
	return temp(2, n) + temp(3, n) - temp(6, n)
t = int(input())
for i in range(t):
	n = int(input())
	print(b(n))


import os
import sys
from io import BytesIO, IOBase
import math
from queue import Queue
import collections
import itertools
import bisect
import heapq
import random

def main():
	pass
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def binary(n):
	return bin(n).replace('0b', '')

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def primeFactors(n):
	cnt = []
	while n % 2 == 0:
		cnt.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			cnt.append(i)
			n = n / i
	if n > 2:
		cnt.append(int(n))
	return cnt

def primeFactorsCount(n):
	cnt = 0
	while n % 2 == 0:
		cnt += 1
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			cnt += 1
			n = n // i
	if n > 2:
		cnt += 1
	return cnt

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def maxPrimeFactors(n):
	maxPrime = -1
	while n % 2 == 0:
		maxPrime = 2
		n >>= 1
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			maxPrime = i
			n = n / i
	if n > 2:
		maxPrime = n
	return int(maxPrime)

def countcon(s, i):
	c = 0
	ch = s[i]
	for i in range(i, len(s)):
		if s[i] == ch:
			c += 1
		else:
			break
	return c

def lis(arr):
	n = len(arr)
	lis = [1] * n
	for i in range(1, n):
		for j in range(0, i):
			if arr[i] > arr[j] and lis[i] < lis[j] + 1:
				lis[i] = lis[j] + 1
	maximum = 0
	for i in range(n):
		maximum = max(maximum, lis[i])
	return maximum

def isSubSequence(str1, str2):
	m = len(str1)
	n = len(str2)
	j = 0
	i = 0
	while j < m and i < n:
		if str1[j] == str2[i]:
			j = j + 1
		i = i + 1
	return j == m

def maxfac(n):
	root = int(n ** 0.5)
	for i in range(2, root + 1):
		if n % i == 0:
			return n // i
	return n

def p2(n):
	c = 0
	while n % 2 == 0:
		n //= 2
		c += 1
	return c

def seive(n):
	primes = [True] * (n + 1)
	primes[1] = primes[0] = False
	i = 2
	while i * i <= n:
		if primes[i] == True:
			for j in range(i * i, n + 1, i):
				primes[j] = False
		i += 1
	return primes
	pr = []
	for i in range(0, n + 1):
		if primes[i]:
			pr.append(i)
	return pr

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def denofactinverse(n, m):
	fac = 1
	for i in range(1, n + 1):
		fac = fac * i % m
	return pow(fac, m - 2, m)

def numofact(n, m):
	fac = 1
	for i in range(1, n + 1):
		fac = fac * i % m
	return fac

def sod(n):
	s = 0
	while n > 0:
		s += n % 10
		n //= 10
	return s

def inv(n, m):
	return pow(n, m - 2, m)
n = 1
d = []
while (n * n) ** 3 <= 10000000000:
	d.append((n * n) ** 3)
	n += 1
for xyz in range(0, int(input())):
	n = int(input())
	sq = cb = 0
	val = 1
	while val * val <= n:
		val += 1
		sq += 1
	val = 1
	while val * val * val <= n:
		val += 1
		cb += 1
	ans = sq + cb
	for i in d:
		if i > n:
			break
		else:
			ans -= 1
	print(ans)


for _ in range(int(input())):
	x = int(input())
	l = [0]
	for i in range(1, x):
		if i * i > x:
			break
		if i * i <= x:
			l.append(i * i)
		if i * i * i <= x:
			l.append(i * i * i)
		else:
			pass
	m = set(l)
	if x == 1:
		print(1)
	else:
		print(len(m) - 1)


for _ in range(int(input())):
	n = int(input())
	z = set()
	for i in range(1, n + 1):
		if i ** 2 <= n:
			z.add(i ** 2)
		else:
			break
		if i ** 3 <= n:
			z.add(i ** 3)
	print(len(z))


import math

def myfloor(a):
	if a - math.floor(a) >= 0.999999999:
		return math.ceil(a)
	else:
		return math.floor(a)

def find(n):
	s = 0
	m = myfloor(math.sqrt(n))
	p = myfloor(n ** (1 / 3))
	r = myfloor(n ** (1 / 6))
	s = m + p - r
	print(s)
k = int(input())
for i in range(k):
	n = int(input())
	find(n)


for _ in range(int(input())):
	initialinput = int(input())
	counter = 0
	cbn = 1
	sqrn = 2
	while cbn ** 3 <= initialinput:
		counter += 1
		cbn += 1
	while sqrn ** 2 <= initialinput:
		counter += 1
		sqrn += 1
	sqrn = 1
	while sqrn ** 6 <= initialinput:
		counter -= 1
		sqrn += 1
	print(counter + 1)


t = int(input())
for i in range(t):
	n = int(input())
	x = 1
	c = 0
	while x * x <= n:
		x += 1
		c += 1
	x = 1
	while x * x * x <= n:
		x += 1
		c += 1
	x = 1
	c1 = 0
	while x ** 6 <= n:
		x += 1
		c1 += 1
	print(c - c1)


from math import ceil
t = int(input())
for _ in range(t):
	n = int(input())
	if n > 1:
		a = [1]
		for i in range(2, ceil(n ** 0.5 + 1)):
			if i ** 2 <= n:
				a.append(i ** 2)
			if i ** 3 <= n:
				a.append(i ** 3)
		print(len(set(a)))
	else:
		print(1)


t = int(input())
for i in range(t):
	d = {}
	n = int(input())
	x = int(n ** (1 / 2))
	k = n ** (1 / 3)
	h = int(k) + 1
	if int(k) == k:
		y = int(k)
	elif h * h * h == n:
		y = h
	else:
		y = int(k)
	for i in range(1, x + 1):
		d[i ** 2] = 1
	for j in range(1, y + 1):
		if j ** 3 not in d.keys():
			d[j ** 3] = 1
	print(len(d))


import math
n = int(input())
for i in range(n):
	num = int(input())
	sqrt = round(num ** 0.5)
	if sqrt ** 2 > num:
		sqrt -= 1
	cbrt = round(num ** (1 / 3))
	if cbrt ** 3 > num:
		cbrt -= 1
	sixrt = round(num ** (1 / 6))
	if sixrt ** 6 > num:
		sixrt -= 1
	ans = sqrt + cbrt - sixrt
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	s = 0
	for i in range(1, 4 * 10 ** 4 + 1):
		if i ** 2 <= n:
			s += 1
		else:
			break
	for i in range(1, 10 ** 3 + 1):
		if i ** 3 <= n:
			s += 1
		else:
			break
	for i in range(1, 10 ** 2 + 1):
		if i ** 6 <= n:
			s -= 1
		else:
			break
	print(s)


t = int(input())

def numsquarecube(num):
	maxsquare = 0
	while maxsquare ** 2 <= num:
		maxsquare += 1
	maxsquare -= 1
	maxcube = 0
	while maxcube ** 3 <= num:
		maxcube += 1
	maxcube -= 1
	maxsixth = 0
	while maxsixth ** 6 <= num:
		maxsixth += 1
	maxsixth -= 1
	return maxsquare + maxcube - maxsixth
for i in range(t):
	n = int(input())
	print(numsquarecube(n))


import sys
import os.path
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
	sys.stderr = open('error.txt', 'w')
depth = 200001
mod = 1000000007
lim = mod * mod
sys.setrecursionlimit(depth)
linp = lambda : list(minp())
minp = lambda : map(int, input().split())
from math import inf, ceil, sqrt, log2, gcd
from collections import defaultdict, deque
dxy = [(1, 0), (-1, 0), (0, 1), (0, -1)]

def expo(a, b):
	if not b:
		return 1
	v = expo(a, b // 2)
	v = v * v % mod
	if b % 2:
		v = v * a % mod
	return v

def modinv(a, b):
	d = expo(b, mod - 2)
	v = a * d % mod
	return v

def checkPrime(n):
	if n < 4:
		return True
	if n % 2 == 0:
		return False
	for i in range(3, int(sqrt(n)) + 1, 2):
		if n % i == 0:
			return False
	return True

def highestPowerof2(x):
	x |= x >> 1
	x |= x >> 2
	x |= x >> 4
	x |= x >> 8
	x |= x >> 16
	return x ^ x >> 1
for _ in range(int(input())):
	n = int(input())
	(s, i) = (set(), 1)
	while i * i <= n:
		s.add(i * i)
		i += 1
	i = 1
	while i * i * i <= n:
		s.add(i * i * i)
		i += 1
	print(len(s))


def find_curt(n):
	c = 0
	for i in range(1, n + 1):
		if i * i * i <= n:
			c += 1
		else:
			break
	return c
for _ in range(int(input())):
	n = int(input())
	sr = int(n ** (1 / 2))
	qr = find_curt(n)
	ans = 0
	for i in range(2, qr + 1):
		temp = i * i * i
		t = temp ** (1 / 2)
		if t == int(t):
			ans += 1
	print(sr + qr - 1 - ans)


def square_cube(n):
	sq = int(math.sqrt(n) // 1)
	qu = int((n ** (1.0 / 3) + 1e-10) // 1)
	six = int((n ** (1.0 / 6) + 1e-10) // 1)
	return sq + qu - six
import math
t = int(input())
for _ in range(0, t):
	n = int(input())
	response = square_cube(n)
	print(f'{response}')


for _ in range(int(input())):
	visited = set()
	n = int(input())
	result = 0
	for i in range(1, int(n ** 0.5) + 1):
		if i ** 2 <= n and i ** 2 not in visited:
			visited.add(i ** 2)
			result += 1
		if i ** 3 <= n and i ** 3 not in visited:
			visited.add(i ** 3)
			result += 1
	print(result)


t = int(input())
for i in range(t):
	n = int(input())
	j = 1
	l1 = []
	while j ** 2 <= n:
		l1.append(j ** 2)
		j = j + 1
	j = 1
	while j ** 3 <= n:
		l1.append(j ** 3)
		j = j + 1
	print(len(set(l1)))


import sys
input = lambda : sys.stdin.readline().rstrip()
T = int(input())
for _ in range(T):
	num = int(input())
	count = 0
	x = 1
	y = set()
	while x * x <= num:
		y.add(x * x)
		x += 1
	x = 1
	while x ** 3 <= num:
		y.add(x ** 3)
		x += 1
	print(len(y))


t = int(input())
for _ in range(t):
	a = int(input())
	count = [1]
	for i in range(2, a, 1):
		if i ** 2 <= a:
			count.append(i ** 2)
		else:
			break
		if i ** 3 <= a:
			count.append(i ** 3)
	count = set(count)
	print(len(count))


for _ in range(int(input())):
	n = int(input())
	s = set()
	i = 1
	while i * i <= n:
		s.add(i * i)
		i += 1
	j = 1
	while j * j * j <= n:
		s.add(j * j * j)
		j += 1
	print(len(s))


for ttt in range(int(input())):
	n = int(input())
	s = set()
	i = 1
	while i * i <= n:
		s.add(i * i)
		i += 1
	i = 1
	while i * i * i <= n:
		s.add(i * i * i)
		i += 1
	print(len(s))


def r(c):
	cs = str(c).index('.')
	ans = 0
	if str(c)[cs:].count('9') >= 12:
		ans += round(c)
	else:
		ans += int(c)
	return ans
for i in range(int(input())):
	n = int(input())
	ans = r(n ** 0.5) + r(n ** (1 / 3.0)) - r(n ** (1 / 6.0))
	print(ans)


for i in range(int(input())):
	n = int(input())
	c = int(n ** (1 / 2))
	d = int(round(n ** (1 / 3), 7))
	e = int(round(n ** (1 / 3), 7) ** (1 / 2))
	print(c + d - e)


import math
for i in range(int(input())):
	n = int(input())
	a = 0
	b = 0
	c = 0
	for j in range(int(math.sqrt(n) + 2)):
		if int(j ** 2) > n and a == 0:
			a = j
		if int(j ** 3) > n and b == 0:
			b = j
		if int(j ** 6) > n and c == 0:
			c = j
	print(a + b - c - 1)


n = int(input())
for i in range(n):
	num = int(input())
	j = 1
	arr = []
	while True:
		if j ** 2 <= num:
			arr.append(j ** 2)
		elif j ** 2 > num:
			break
		if j ** 3 <= num:
			arr.append(j ** 3)
		j += 1
	print(len(set(arr)))


t = int(input())
for i in range(t):
	b = int(input())
	b = b + 0.99
	a = int(b ** (1 / 2)) + int(b ** (1 / 3)) - int(b ** (1 / 6))
	print(a)


n = int(input())
for i in range(n):
	a = int(input()) + 0.0001
	sq = int(a ** 0.5)
	cu = int(a ** (1 / 3))
	s = int(a ** (1 / 6))
	print(sq + cu - s)


import math
n = int(input())
for i in range(n):
	x = int(input())
	c = 0
	for j in range(1, x):
		if j ** 2 <= x:
			c += 1
		if j ** 3 <= x and j != 1 and (not math.sqrt(j ** 3).is_integer()):
			c += 1
		if j ** 2 > x:
			break
	if c == 0:
		print(1)
	else:
		print(c)


from math import sqrt
for _ in range(int(input())):
	n = int(input())
	a = int(n ** 0.5)
	b = int(n ** 0.3333333333334)
	c = int(n ** 0.1666666666667)
	print(a + b - c)


n = int(input())
for _ in range(n):
	num = int(input())
	arr = []
	for i in range(1, int(num ** 0.5) + 1):
		if i ** 2 <= num:
			arr.append(i ** 2)
		if i ** 3 <= num:
			arr.append(i ** 3)
	print(len(set(arr)))


n = int(input())
for k in range(n):
	t = int(input())
	s = set()
	for i in range(1, int(t ** 0.5) + 1):
		if i * i <= t:
			s.add(i * i)
		if i * i * i <= t:
			s.add(i * i * i)
	print(len(s))


n = int(input())
answer = []
k = []
for i in range(n):
	s = int(input())
	answer.append(s)
for j in answer:
	ans = {1: 1}
	if j < 4:
		k.append(1)
	elif j < 8:
		k.append(2)
	else:
		for i in range(2, j // 2 + 1):
			if i ** 3 <= j:
				ans[i ** 3] = ans.get(i ** 3, 0) + 1
				ans[i ** 2] = ans.get(i ** 2, 0) + 1
			elif i ** 2 <= j:
				ans[i ** 2] = ans.get(i ** 2, 0) + 1
			else:
				k.append(len(ans))
				break
for i in k:
	print(i)


for _ in range(int(input())):
	n = int(input())
	s = set()
	for i in range(1, 31623):
		if i * i <= n:
			s.add(i * i)
		if i * i * i <= n:
			s.add(i * i * i)
	print(len(s))


import sys
input = lambda : sys.stdin.readline().rstrip()
INF = 10 ** 19

def solve():
	s = set()
	n = int(input())
	for i in range(1, n + 1):
		if i * i <= n:
			s.add(i * i)
		else:
			break
	for i in range(1, n + 1):
		if i * i * i <= n:
			s.add(i * i * i)
		else:
			break
	print(len(s))
t = int(input())
for _ in range(t):
	solve()


import math
t = int(input())
for _ in range(t):
	n = int(input())
	sqrt = int(n ** 0.5)
	res = 1
	used = set()
	for num in range(2, sqrt + 1):
		if num ** 3 <= n:
			used.add(num ** 3)
			res += 1
		if num ** 2 not in used and num ** 2 <= n:
			used.add(num ** 2)
			res += 1
	print(res)


import math
t = int(input())
for i in range(t):
	n = int(input())
	r = n ** (1.0 / 3.0)
	s = set()
	for j in range(1, int(math.sqrt(n) + 1)):
		if j * j <= n:
			s.add(j * j)
		if j * j * j <= n:
			s.add(j * j * j)
	print(len(s))


for i in range(int(input())):
	n = int(input())
	i = 1
	res = []
	while i * i <= n:
		res.append(i * i)
		i = i + 1
	i = 1
	while i * i * i <= n:
		res.append(i * i * i)
		i = i + 1
	result = set(res)
	count = 0
	for i in result:
		if i <= n:
			count += 1
	print(count)


import math
T = int(input())
for ttt in range(T):
	dt = {}
	n = int(input())
	t = int(math.sqrt(n)) + 1
	res = 0
	for i in range(1, t + 1):
		t1 = i * i
		if t1 <= n and t1 not in dt:
			dt[t1] = True
			res += 1
		t2 = i * i * i
		if t2 <= n and t2 not in dt:
			dt[t2] = True
			res += 1
	print(res)


s = set()
for i in range(1, int(10 ** 4.5) + 1):
	s.add(i ** 2)
	if i <= 10 ** 3:
		s.add(i ** 3)
l = list(s)
l = sorted(l)
t = int(input())
for _ in range(t):
	n = int(input())
	cnt = 0
	for e in l:
		if e <= n:
			cnt += 1
		else:
			break
	print(cnt)


from collections import defaultdict
for _ in range(int(input())):
	n = int(input())
	ans = defaultdict(int)
	j = 1
	while j ** 2 <= n:
		ans[j ** 2] += 1
		j += 1
	i = 1
	while i ** 3 <= n:
		ans[i ** 3] += 1
		i += 1
	print(len(ans))


import math, collections
for _ in range(int(input())):
	n = int(input())
	g = math.sqrt(n)
	x = int(g)
	h = n ** (1 / 3)
	y = int(h)
	y += math.isclose(1, h - y, rel_tol=1e-10)
	b = collections.defaultdict(int)
	for k in range(1, y + 1):
		b[k ** 3] = 1
	c = 0
	for l in range(1, x + 1):
		c += b[l ** 2]
	print(x + y - c)


import math
t = int(input())
while t > 0:
	n = int(input())
	li = []
	for i in range(1, int(math.sqrt(n) + 1)):
		sq = i ** 2
		cb = i ** 3
		if sq <= n:
			li.append(sq)
		if cb <= n:
			li.append(cb)
	print(len(set(li)))
	t -= 1


import math
tst = int(input())
result = []
for i in range(tst):
	n = int(input())
	x = 0
	for i in range(1, int(math.sqrt(n)) + 1):
		if i * i <= n:
			x += 1
		if i * i * i <= n:
			x += 1
		if i * i * i * i * i * i <= n:
			x -= 1
	result.append(x)
for i in range(tst):
	print(result[i])


import math
t = int(input())
for tc in range(t):
	n = int(input())
	ans = 1
	arr = set()
	i = 2
	while True:
		sq = i * i
		cu = i * i * i
		if sq <= n:
			if sq not in arr:
				ans += 1
				arr.add(sq)
			if cu <= n:
				if cu not in arr:
					ans += 1
					arr.add(cu)
		else:
			break
		i += 1
	print(ans)


t = int(input())
EPS = 1e-09
for i in range(t):
	n = int(input())
	print(int(n ** (1 / 2) + EPS) + int(n ** (1 / 3) + EPS) - int(n ** (1 / 6) + EPS))


import math
t = int(input())
count = 0
a = True
l = set()
li = []
for _ in range(0, t):
	n = int(input())
	r = int(math.sqrt(n))
	for i in range(1, r + 1):
		if i == 1:
			count += 1
			l.add(1)
			continue
		double_i = i ** 2
		if double_i <= n:
			count += 1
			l.add(double_i)
		else:
			break
		cube_i = i ** 3
		if cube_i <= n and a:
			count += 1
			l.add(cube_i)
		else:
			a = False
	li.append(len(l))
	l = set()
	count = 0
	a = True
for x in li:
	print(x)


def count(a):
	counter = 1
	for i in range(2, a):
		square = i ** 2
		cube = i ** 3
		sixth = i ** 6
		if square <= a:
			counter += 1
		if cube <= a:
			counter += 1
		if sixth <= a:
			counter -= 1
		if square > a:
			break
	return counter
t = int(input())
for i in range(t):
	a = int(input())
	print(count(a))


import math
n = int(input())
for x in range(0, n):
	mylist = []
	num = int(input())
	i = 1
	while i ** 2 <= num:
		mylist.append(i ** 2)
		i += 1
	j = 1
	while j ** 3 <= num:
		if int(math.sqrt(j ** 3)) ** 2 != j ** 3:
			mylist.append(j ** 3)
		j += 1
	print(len(mylist))


x = 0
for _ in range(int(input())):
	a = int(input())
	s = []
	i = 0
	while True:
		i += 1
		if i ** 2 <= a:
			s.append(i * i)
		else:
			break
		if i ** 3 <= a:
			s.append(i ** 3)
	print(len(set(s)))


t = int(input())
for _ in range(t):
	n = int(input())
	a = int(n ** 0.5)
	b = int(n ** (1.0 / 3))
	c = int(n ** (1 / 6))
	if (a + 1) ** 2 <= n:
		a += 1
	if (b + 1) ** 3 <= n:
		b += 1
	if (c + 1) ** 6 <= n:
		c += 1
	print(a + b - c)


t = int(input())
for i in range(t):
	n = int(input())
	c = int(round(n ** (1 / 3), 0))
	s = int(round(n ** (1 / 2), 0))
	lc = ls = []
	for i in range(1, c + 1):
		lc.append(i ** 3)
	for i in range(1, s + 1):
		ls.append(i ** 2)
	a = [i for i in lc if i > n]
	b = [i for i in ls if i > n]
	a = set(a)
	b = set(b)
	lc = set(lc)
	lc = lc.difference(a)
	ls = set(ls)
	ls = ls.difference(b)
	k = lc.union(ls)
	print(len(k))


for _ in range(int(input())):
	n = int(input())
	m = []
	i = 0
	while i ** 6 <= n:
		m += [i ** 6]
		i += 1
	k = 1
	for i in range(2, 10 ** 5):
		t = i ** 2
		t1 = i ** 3
		if t > n:
			break
		elif t <= n and t1 > n and (t not in m):
			k += 1
		elif t <= n and t1 > n and (t in m):
			k += 0
		elif t1 <= n and t in m:
			k += 1
		elif t1 <= n and t not in m:
			k += 2
	print(k)


for i in range(int(input())):
	n = int(input())
	ans = [0]
	if n == 1:
		print(1)
	else:
		for i in range(1, n):
			if i * i > n:
				break
			if i * i <= n:
				ans.append(i * i)
			if i * i * i <= n:
				ans.append(i * i * i)
		print(len(set(ans)) - 1)


import math
from typing import List

def solve():
	n = int(input())
	squrt = math.floor(math.sqrt(n))
	ans = squrt
	cubes = 1
	Set = set()
	for i in reversed(range(squrt + 1)):
		if i * i * i <= n:
			ans += i
			cubes = i
			break
	while squrt > 0:
		Set.add(squrt * squrt)
		squrt -= 1
	while cubes > 0:
		Set.add(cubes * cubes * cubes)
		cubes -= 1
	print(len(Set))
cases = int(input())
for i in range(cases):
	solve()


t = int(input())
for e in range(t):
	n = int(input())
	summ = 0
	i = 1
	while i * i <= n:
		summ += 1
		i += 1
	j = 1
	while j * j * j <= n:
		summ += 1
		j += 1
	e = 1
	while e ** 6 <= n:
		summ -= 1
		e += 1
	print(summ)


def squares_cubes(n):
	lst = []
	i = 1
	while i * i <= n:
		lst.append(i * i)
		i += 1
	j = 1
	while j * j * j <= n:
		lst.append(j * j * j)
		j += 1
	unique_lst = set(lst)
	print(len(unique_lst))
t = int(input())
for j in range(t):
	n = int(input())
	squares_cubes(n)


import math
t = int(input())
while t > 0:
	n = int(input())
	if n == 1:
		print(1)
	else:
		res = set()
		i = 2
		while i * i <= n:
			res.add(i * i)
			if i * i * i <= n:
				res.add(i * i * i)
			i += 1
		print(len(res) + 1)
	t -= 1


import sys
I = lambda : [*map(int, sys.stdin.readline().split())]
(t,) = I()
for _ in range(t):
	(n,) = I()
	sq = int(n ** 0.5 + 1e-11)
	cb = int(n ** (1 / 3) + 1e-11)
	six = int(n ** (1 / 6) + 1e-11)
	print(sq + cb - six)


import math
for _ in range(int(input())):
	n = int(input())
	p = int(math.sqrt(n))
	common = 0
	for i in range(2, p + 1):
		if i ** 6 <= n:
			common += 1
		else:
			break
	q = n ** (1 / 3)
	ans = p + q - 1 - common
	print(int(ans))


n = int(input())
a = []
for i in range(n):
	x = int(input())
	y = int(pow(x, 0.5))
	z = int(pow(x, 1 / 3))
	r = 0
	b = 0
	if (z + 1) ** 3 == x:
		r = 1
	c = int(pow(x, 1 / 6))
	if (c + 1) ** 6 == x:
		b = -1
	a.append(y + z - c + r + b)
for i in range(n):
	print(a[i])


def f(n, k):
	lev = 1
	prav = n + 1
	u = (lev + prav) // 2
	while lev + 1 < prav:
		if u ** k > n:
			prav = u
		else:
			lev = u
		u = (lev + prav) // 2
	return lev
t = int(input())
for i in range(t):
	n = int(input())
	print(f(n, 2) + f(n, 3) - f(n, 6))


t = int(input())
while t:
	t -= 1
	s = int(input())
	sq = cub = scu = 0
	import math
	sq = math.ceil(s ** (1 / 2))
	if sq * sq != s:
		sq -= 1
	cub = math.ceil(s ** (1 / 3))
	if cub ** 3 != s:
		cub -= 1
	scu = math.ceil(s ** (1 / 6))
	if scu ** 6 != s:
		scu -= 1
	print(sq + cub - scu)


a = int(input())
import math
i = 0
while i < a:
	b = int(input())
	s = int(b ** (1 / 2))
	p = int(b ** (1 / 3))
	k = int(b ** (1 / 6))
	if (s + 1) ** 2 == b:
		s = s + 1
	if (p + 1) ** 3 == b:
		p = p + 1
	if (k + 1) ** 6 == b:
		k = k + 1
	print(s + p - k)
	i = i + 1


t = int(input())
for a in range(t):
	n = int(input())
	x = set()
	for i in range(1, n + 1):
		if i ** 2 > n:
			break
		else:
			x.add(i ** 2)
	for i in range(1, n + 1):
		if i ** 3 > n:
			break
		else:
			x.add(i ** 3)
	print(len(x))


cases = int(input())
for i in range(cases):
	numbers = {1}
	variable = 2
	number = int(input())
	while True and number != 1:
		if variable ** 2 <= number:
			numbers.add(variable ** 2)
		else:
			break
		if variable ** 3 <= number:
			numbers.add(variable ** 3)
		variable += 1
	print(len(numbers))


squares = set()
for i in range(1, int((10 ** 9 + 1) ** 0.5) + 1):
	squares.add(i ** 2)
cubes = set()
for i in range(1, int((10 ** 9 + 1) ** (1 / 3)) + 1):
	cubes.add(i ** 3)
both = squares.union(cubes)
both = sorted(both)
t = int(input())
for _ in range(t):
	n = int(input())
	ans = 0
	for num in both:
		if num <= n:
			ans += 1
		else:
			break
	print(ans)


t = int(input())
for i in range(t):
	num = int(input())
	counter = 1
	numbers = set()
	while counter * counter <= num:
		if counter * counter <= num:
			numbers.add(counter ** 2)
		if counter * counter * counter <= num:
			numbers.add(counter ** 3)
		counter += 1
	print(len(numbers))


import sys
import math
from bisect import bisect_right as br
from collections import deque
from itertools import combinations as cb

def int_arr():
	return list(map(int, sys.stdin.readline().strip().split()))

def str_arr():
	return list(map(str, sys.stdin.readline().strip().split()))

def input():
	return sys.stdin.readline().strip()
for _ in range(int(input())):
	n = int(input())
	cnt = 0
	i = 1
	s = set()
	while True:
		c = i * i
		if c <= n:
			s.add(c)
		else:
			break
		if c * i <= n:
			s.add(c * i)
		i += 1
	print(len(s))


from itertools import combinations
import time
n = []
for i in range(1, 31623):
	n.append(i ** 2)
for j in range(1, 1001):
	n.append(j ** 3)
a = list(set(n))
a.sort()
p = int(input())
l = []
for i in range(p):
	y = int(input())
	l.append(y)
g = []
for i in l:
	c = 0
	for j in a:
		if j <= i:
			c += 1
	g.append(c)
for i in g:
	print(i)


n = int(input())
for i in range(n):
	c = int(input())
	count = set()
	for k in range(c + 1):
		l = k ** 2
		if k ** 2 > c:
			break
		count.add(l)
	for k in range(c + 1):
		l = k ** 3
		if k ** 3 > c:
			break
		count.add(l)
	print(len(count) - 1)


from __future__ import unicode_literals
from __future__ import print_function
import time
import math
import random

def func():
	m = 1000000000
	j = 63
	while j < m:
		num1 = j ** (1 / 2)
		num2 = j ** (1 / 3)
		if isint(num1) == True and isint(num2) == True:
			print(j)
		j += 1

def isint(s):
	try:
		int(s)
		return True
	except ValueError:
		return False
a = int(input())
i = 0
while i < a:
	j = 0
	chislo = int(input())
	slag1 = chislo ** (1 / 2)
	slag1 += 1e-12
	slag2 = pow(chislo, 1 / 3)
	slag2 += 1e-12
	vich = chislo ** (1 / 6)
	vich += 1e-12
	vich = int(vich)
	slag1 = int(slag1)
	slag2 = int(slag2)
	answer = slag1 + slag2 - vich
	print(answer)
	i += 1


import math
for i in range(int(input())):
	a = set()
	num = int(input())
	for j in range(1, int(math.sqrt(num)) + 1):
		if j ** 2 <= num:
			a.add(j ** 2)
		if j ** 3 <= num:
			a.add(j ** 3)
	print(len(a))


import math
n = int(input())
for i in range(n):
	s = int(input())
	a = s ** (1 / 2)
	b = s ** (1 / 3)
	c = s ** (1 / 6)
	b1 = math.ceil(b)
	b2 = int(b)
	c1 = math.ceil(c)
	c2 = int(c)
	if b1 ** 3 == s:
		k = int(a) + b1
	else:
		k = int(a) + b2
	if c1 ** 6 == s:
		k = k - c1
	else:
		k = k - c2
	print(k)


for _ in range(int(input())):
	n = int(input())
	ans = 0
	for i in range(int(n ** 0.5) + 1):
		if i * i <= n:
			ans += 1
		if i * i * i <= n:
			ans += 1
		if i * i * i <= n and int((i * i * i) ** 0.5) == (i * i * i) ** 0.5:
			ans -= 1
	print(ans - 1)


t = int(input())
for i in range(t):
	num = int(input())
	if num < 4:
		print(1)
	else:
		kv = int(round(num ** 0.5, 10))
		kubs = int(round(num ** (1 / 3), 10))
		st6 = int(round(num ** (1 / 6), 10))
		print(kv + kubs - st6)


import math
t = int(input())
for _ in range(t):
	n = int(input())
	count = 0
	count += int(math.sqrt(n))
	x = math.ceil(n ** (1 / 3))
	if x * x * x > n:
		x = x - 1
	for i in range(1, int(x + 1)):
		x = i * i * i
		if math.sqrt(x).is_integer():
			count += 0
		else:
			count += 1
	print(count)


for _ in range(int(input())):
	n = int(input())
	s = set()
	for i in range(n + 1):
		if i * i > n:
			break
		s.add(i * i)
	for i in range(n + 1):
		if i * i * i > n:
			break
		s.add(i * i * i)
	s.remove(0)
	print(len(s))


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = set()
	for i in range(1, n + 1):
		if i ** 2 > n:
			break
		elif i ** 3 <= n:
			a.add(i ** 3)
		a.add(i ** 2)
	print(len(a))


s2 = 2
s3 = 2
a_list = [1]
while a_list[-1] < 1000000000.0 + 1:
	if s2 * s2 < s3 * s3 * s3:
		a_list.append(s2 * s2)
		s2 += 1
	elif s2 * s2 > s3 * s3 * s3:
		a_list.append(s3 * s3 * s3)
		s3 += 1
	else:
		a_list.append(s2 * s2)
		s2 += 1
		s3 += 1

def getResult(m):
	for i in range(len(a_list)):
		if a_list[i] > m:
			return i
n = int(input())
for i in range(n):
	m = int(input())
	print(getResult(m))


for _ in range(int(input())):
	t = int(input())
	s1 = int(t ** (1 / 2))
	if (s1 + 1) ** 2 == t:
		s1 += 1
	s2 = int(t ** (1 / 3))
	if (s2 + 1) ** 3 == t:
		s2 += 1
	s3 = int(t ** (1 / 6))
	if (s3 + 1) ** 6 == t:
		s3 += 1
	print(s1 + s2 - s3)


import math
t = int(input())
l = []
for i in range(0, t):
	l.append(int(input()))
for i in range(0, t):
	sq = l[i] ** 0.5
	sq = math.floor(sq)
	if (sq + 1) ** 2 <= l[i]:
		sq = sq + 1
	cb = l[i] ** (1 / 3)
	cb = math.floor(cb)
	if (cb + 1) ** 3 <= l[i]:
		cb = cb + 1
	sr = l[i] ** (1 / 6)
	sr = math.floor(sr)
	if (sr + 1) ** 6 <= l[i]:
		sr = sr + 1
	print(sq + cb - sr)


import bisect
import sys
input = sys.stdin.readline
t = int(input())
x = set()
for i in range(1, pow(10, 5)):
	x.add(i * i)
for i in range(1, pow(10, 3) + 5):
	x.add(i * i * i)
x = list(x)
x.sort()
for _ in range(t):
	n = int(input())
	ans = bisect.bisect_left(x, n + 0.5)
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	result = set()
	i = 1
	while i * i <= n:
		result.add(i * i)
		i += 1
	i = 1
	while i * i * i <= n:
		result.add(i * i * i)
		i += 1
	print(len(result))


t = int(input())
for _ in range(t):
	n = int(input())
	seen = set()
	i = 1
	while i * i <= n:
		seen.add(i * i)
		i += 1
	i = 1
	while i * i * i <= n:
		seen.add(i * i * i)
		i += 1
	print(len(seen))


for i in range(int(input())):
	n = int(input())
	count = [0]
	if n == 1:
		print(1)
	else:
		for i in range(1, n):
			if i * i > n:
				break
			if i * i <= n:
				count.append(i * i)
			if i * i * i <= n:
				count.append(i * i * i)
			else:
				pass
		print(len(set(count)) - 1)


import math
t = int(input())
for i in range(t):
	n = int(input())
	ans = int(math.sqrt(n))
	count = []
	for i in range(1, ans + 1):
		if i * i <= n:
			count.append(i * i)
	for i in range(1, ans + 1):
		if i * i * i <= n:
			count.append(i * i * i)
	print(len(set(count)))


from bisect import bisect_left
dp = set()

def generate_items():
	global dp
	i = 1
	while i ** 2 <= int(1000000000.0):
		dp.add(i ** 2)
		dp.add(i ** 3)
		i += 1

def answer(x):
	if x in dp:
		return dp.index(x) + 1
	else:
		return bisect_left(dp, x)
generate_items()
dp = sorted(list(dp))
for _ in range(int(input())):
	print(answer(int(input())))


t = int(input())
import math
for _ in range(t):
	n = int(input())
	a = set()
	for i in range(1, int(math.sqrt(n)) + 1):
		a1 = i ** 2
		a2 = i ** 3
		if a1 <= n:
			a.add(a1)
		if a2 <= n:
			a.add(a2)
	print(len(a))


import math
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(1)
		continue
	no_s = math.floor(n ** (1 / 2))
	if int(round(n ** (1.0 / 3))) ** 3 == n:
		no_c = int(round(n ** (1.0 / 3)))
	else:
		no_c = math.floor(n ** (1 / 3))
	ans = no_s + no_c
	for i in range(1, no_c + 1):
		if i ** 3 <= no_s:
			ans -= 1
	print(ans)


import os
import sys
from bisect import *
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
readint = lambda : int(sys.stdin.readline().rstrip('\r\n'))
readints = lambda : map(int, sys.stdin.readline().rstrip('\r\n').split())
readstr = lambda : sys.stdin.readline().rstrip('\r\n')
readstrs = lambda : map(str, sys.stdin.readline().rstrip('\r\n').split())
readarri = lambda : [int(_) for _ in sys.stdin.readline().rstrip('\r\n').split()]
readarrs = lambda : [str(_) for _ in sys.stdin.readline().rstrip('\r\n').split()]
pre = []
MAXN = int(1000000000.0) + int(1000000.0)
start = 1
while start * start <= MAXN:
	pre.append(start * start)
	start += 1
start = 1
while start * start * start <= MAXN:
	pre.append(start * start * start)
	start += 1
pre = sorted(set(pre))

def solve():
	n = readint()
	print(bisect_right(pre, n))

def main():
	t = 1
	t = readint()
	for _ in range(t):
		solve()
main()


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
import math
import collections
from itertools import permutations
from itertools import combinations

def prob():
	n = int(input())
	st = set()
	for i in range(1, n + 1):
		if i * i > n:
			break
		st.add(i * i)
	for i in range(1, n + 1):
		if i * i * i > n:
			break
		st.add(i * i * i)
	print(len(st))
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = 1
t = int(input())
for _ in range(0, t):
	prob()


def root(n, k):
	lo = 0
	hi = n + 1
	while hi - lo > 1:
		mid = (lo + hi) // 2
		if mid ** k > n:
			hi = mid
		else:
			lo = mid
	return lo
for _ in range(int(input())):
	n = int(input())
	ans = root(n, 2)
	ans += root(n, 3)
	ans -= root(n, 6)
	print(ans)


import math as mt
t = int(input())
for i in range(t):
	m = int(input())
	x = mt.sqrt(m)
	x = int(x)
	y = m ** (1 / 3)
	z = m ** (1 / 6)
	z = int(z)
	y = int(y)
	if (y + 1) * (y + 1) * (y + 1) == m:
		y += 1
	if mt.pow(z + 1, 6) == m:
		z += 1
	ans = x + y - z
	print(ans)


def nroot(n, x):
	return x ** (1 / float(n))

def solve():
	for _ in range(int(input())):
		x = int(input()) + 0.5
		print(int(nroot(2, x)) + int(nroot(3, x)) - int(nroot(6, x)))
solve()


for i in range(int(input())):
	a = int(input()) + 0.99
	print(int(a ** 0.5) + int(a ** (1 / 3)) - int(a ** (1 / 6)))


t = int(input())
for i in range(t):
	n = int(input())
	l = list()
	x = 2
	summa = 1
	square = x ** 2
	while square <= n:
		cube = x ** 3
		if cube <= n:
			l.append(cube)
			summa += 1
		if len(l) > 0:
			if square != l[0]:
				summa += 1
			else:
				l.remove(square)
		else:
			summa += 1
		x += 1
		square = x ** 2
		while len(l) > 0 and square > l[0]:
			l.pop(0)
	print(summa)


from math import *
t = int(input())
for _ in range(t):
	n = int(input())
	ans = set()
	for i in range(1, int(sqrt(n)) + 1):
		if i ** 2 <= n:
			ans.add(i ** 2)
		if i ** 3 <= n:
			ans.add(i ** 3)
	print(len(ans))