description: 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 ≤ t ≤ 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 ≤ n ≤ 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.
  
  Example
  
  Input
  
  
  6
  10
  1
  25
  1000000000
  999999999
  500000000
  
  
  Output
  
  
  4
  1
  6
  32591
  32590
  23125
solution: import java.util.*;
  import java.io.*;
  import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.util.Scanner;
  import java.util.StringTokenizer;
   
  public class Test{
   
          static FastReader scan;
          static ArrayList<Integer>al=new ArrayList<>();
   
          static void solve(){
              int n=scan.nextInt();
              for(int i=0;i<al.size();i++){
                  if(al.get(i)==n){
                      System.out.println(i+1);
                      return;
                  }
                  if(al.get(i)>n){
                      System.out.println(i);
                      return;
                  }
  
              }
  
  
          }
  
          public static void main (String[] args) throws java.lang.Exception{
              scan=new FastReader();
              HashSet<Integer>set=new HashSet<>();
              al.add(1);
              for(int i=2;i*i<=(int)1e9;i++){
                  if(i*i>(int)1e9)break;
                      set.add(i*i);
                      al.add(i*i);
              }
              for(int i=2;i*i*i<=(int)1e9;i++){
                  if(i*i*i>(int)1e9)break;
  
                  if(!set.contains(i*i*i))al.add(i*i*i);
              }
              Collections.sort(al);
              
              int t=scan.nextInt();
              while(t-->0){
                  solve();
              }
          }
  
          static boolean sq(int i){
              int temp=(int)Math.sqrt(i);
              return temp*temp==i;
          }
  
          static boolean cb(int i){
              int temp=(int)Math.cbrt(i);
              return temp*temp*temp==i;
          }
   
          static class FastReader {
              BufferedReader br;
              StringTokenizer st;
   
              public FastReader()
              {
                  br = new BufferedReader(
                      new InputStreamReader(System.in));
              }
   
              String next()
              {
                  while (st == null || !st.hasMoreElements()) {
                      try {
                          st = new StringTokenizer(br.readLine());
                      }
                      catch (IOException e) {
                          e.printStackTrace();
                      }
                  }
                  return st.nextToken();
              }
   
              int nextInt() { return Integer.parseInt(next()); }
   
              long nextLong() { return Long.parseLong(next()); }
   
              double nextDouble() { return Double.parseDouble(next()); }
   
              String nextLine()
              {
                  String str = "";
                  try {
                      str = br.readLine();
                  }
                  catch (IOException e) {
                      e.printStackTrace();
                  }
                  return str;
              }
          }
   
          static class Pair implements Comparable<Pair>{
              int e;
              int wt;
              Pair(int x,int y){
                  this.e=x;
                  this.wt=y;
              }
              @Override
              public int compareTo(Pair x){
                  return (int)(x.wt-this.wt);
              }
          }        
   
          static void printLong(long []arr){
              for(long x:arr)System.out.print(x+" ");
          }
   
          static void printInt(int []arr){
              for(int x:arr)System.out.print(x+" ");
          }
   
          static void scanInt(int []arr){
              for(int i=0;i<arr.length;i++){
                  arr[i]=scan.nextInt();
              }
          }
   
          static void scanLong(long []arr){
              for(int i=0;i<arr.length;i++){
                  arr[i]=scan.nextLong();
              }
          }
   
          static long gcd(long a, long b){
              if (b == 0)
                  return a;
              
              return gcd(b, a % b);
          }   
   
          static long power(long x, long y, long mod){
              long res = 1; 
          
              x = x % mod; 
           
              if (x == 0)
                return 0; 
           
              while (y > 0){              
                  if ((y & 1) != 0)
                  res = (res * x) % mod;
                
                  y = y >> 1; 
                  x = (x * x) % mod;
              }
                  return res;
          }
   
          static long add(long a,long b,long mod){
              a = a % mod; 
              b = b % mod; 
              return (((a + b) % mod) + mod) % mod;
          }
   
          static long sub(long a, long b,long mod){
              a = a % mod; 
              b = b % mod; 
              return (((a - b) % mod) + mod) % mod;
          }
   
          static long mul(long a, long b,long mod){
              a = a % mod; 
              b = b % mod; 
              return (((a * b) % mod) + mod) % mod;
          }
          
   
          static long mminvprime(long a, long b,long mod) {
              return power(a, b - 2,mod);
          }
  }