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: /* JAIKARA SHERAWAALI DA BOLO SACHE DARBAR KI JAI
  HAR HAR MAHADEV JAI BHOLENAATH
  Rohit Kumar 
  NIT JAMSHEDPUR
  
  
          "Everything in the universe is balanced. Every disappointment
                  you face in life will be balanced by something good for you!
                          Keep going, never give up."
   
  */
   
   
  
  import java.util.*;
  
  import java.io.*;
  
  public class Main
  {   
        
     static class FastReader{
  
         BufferedReader br;
         StringTokenizer st;
  
         public FastReader(){
  
         br=new BufferedReader(new InputStreamReader(System.in));
  
  
         }
  
         String next(){
  
         while(st==null||!st.hasMoreTokens()){
           
           try{
  
            st=new StringTokenizer(br.readLine());
  
           }
           catch(IOException e){
  
              e.printStackTrace();
           }
             
  
  
  
         }
         return st.nextToken();}
  
        long nextLong(){ return Long.parseLong(next());}
  
        int nextInt(){ return Integer.parseInt(next());}
  
  
         }
       
     static <t>void print(t o){
      System.out.println(o);
     }
      
     static boolean islapindrome(String s){
  
         int fhalf[]=new int[26];
         int shalf[]=new int[26];
  
          int i=0,j=s.length()-1;
          while(i<j){
             fhalf[s.charAt(i)-'a']++;
             shalf[s.charAt(j)-'a']++;
     i++;
     j--;
     
  
          }
  
          for(int k=0;k<26;k++){
            if(fhalf[k]!=shalf[k])return false;
          }
      return true;
  
  
  
  
     }
  
      static int mod=(int)1e9+7;
      
  
    public static void main (String args[]) throws IOException{
    try{
      System.setIn(new FileInputStream("input.txt"));
      System.setOut(new PrintStream(new FileOutputStream("output.txt"))); } 
      catch (Exception e) {
      System.err.println("Error");
       }
       
       
       FastReader sc=new FastReader();
       int tt=sc.nextInt();
        while(tt-->0)
        {
           long n=sc.nextLong();
            long n1=(long)Math.sqrt(n);
            long n2=(long)Math.cbrt(n);
            long n3=(long)Math.sqrt(n2);
            System.out.println(n1+n2-n3);
           
  
          //  for(int i=0;i<n;i++)
          //  {
          //      arr[i]=sc.nextInt();
          //  }
          //System.out.println(ans);         
  
  
  
  
        } 
  
  
         
  
  
  
  
      }
      
   
      static void reverse(int[] arr, int from, int till) {
          for (int i = from, j = till; i < j; i++, j--) {
              swap(arr, i, j);
          }
      }
  
      static void swap(int[] arr, int a, int b) {
          int tmp = arr[a];
          arr[a] = arr[b];
          arr[b] = tmp;
      }
  
      
      
      
      void sieveOfEratosthenes(int n)
      {
          boolean prime[] = new boolean[n+1];
          for(int i=0;i<=n;i++)
              prime[i] = true;
           
          for(int p = 2; p*p <=n; p++)
          {
              if(prime[p] == true)
              {
                  for(int i = p*p; i <= n; i += p)
                      prime[i] = false;
              }
          }
          for(int i = 2; i <= n; i++)
          {
              if(prime[i] == true)
                  System.out.print(i + " ");
          }
      }
      static long gcd(long a,long b)
      {
          if(b==0) return a;
          
          return gcd(b,a%b);
      }
      static boolean isprime(int n)
      {
          if(n<=1)
           return false;
          
          if(n<=3)
           return true;
          
          if(n%2==0||n%3==0)
           return false;
          
          for(int i=5;i*i<=n;i=i+6)
          {
              if(n%i==0||n%(i+2)==0)
                return false;
          }
          return true;
      }
  
  
  
     }
   