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.io.*;
  import java.util.*;
  
  public class sqandcubes {
      static class FastReader {
          BufferedReader br;
          StringTokenizer st;
  
          public FastReader()
          {
              br = new BufferedReader(
                  new InputStreamReader(System.in));
          }
          public FastReader(String file_name)throws IOException
          {
              br = new BufferedReader(
                  new FileReader(file_name));
          }
  
          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;
          }
          
          public int[] nextArray(int n){
              int ar[] = new int[n];
              for(int i=0;i<n;i++)
                  ar[i] = this.nextInt();
              return (ar);
          }
      }
  
     static class OutputWriter{
          BufferedWriter writer;
  
           public OutputWriter(OutputStream stream){
             writer = new BufferedWriter(new OutputStreamWriter(stream));
           }
  
           public OutputWriter(String file_name) throws IOException{
             writer = new BufferedWriter(new FileWriter("output.txt"));
           }
         
           public void print(int i) throws IOException {
             writer.write(i);
           }
  
           public void print(String s) throws IOException {
              writer.write(s);
            }
  
           public void print(char []c) throws IOException {
              writer.write(c);
           }
  
           public void println(int i) throws IOException {
             writer.write(i+"\n");
           }
  
           public void println(long i) throws IOException {
             writer.write(i+"\n");
           }
  
           public void println(String s) throws IOException {
              writer.write(s+"\n");
            }
  
           public void println(char []c) throws IOException {
              writer.write(c+"\n");
           }
  
           public  void close() throws IOException {
              writer.close();
           }
  
      }
      public static long gcd(long a,long b){
          return(a==0?b:gcd(b%a,a));
      }
      public static long lcm(long a,long b){
          //return (a*b)/gcd(a,b);
          //this is modified to avoid integer overflow by multiplying a*b
          return((a/gcd(a,b))*b);
      }
      public static void initialize_io_redirection()throws IOException{
          try{
              boolean MP = System.getProperty("MY_PC")!=null;
              if(MP){
                  fs = new FastReader("input.txt");
                  op = new OutputWriter("output.txt");
                  System.setOut(new PrintStream(new File("output.txt")));
              }
              else{
                  fs = new FastReader();
                  op = new OutputWriter(System.out);
              }
         }
         catch(Exception e){
              fs = new FastReader();
              op = new OutputWriter(System.out);
         }
      }
     static FastReader fs;
     static OutputWriter op;
      public static void main(String[] args)throws IOException{
          initialize_io_redirection();
          int t = fs.nextInt();
          while(t-- > 0)
              solve();
          op.close();
      }
      static int sqc(long N)
      {
          int p=0,i=1;
          while ((int)(Math.pow(i, 6))<=N) {
              ++p;
              ++i;
          }
          return p;
      }
      public static void solve()throws IOException{
          long n = fs.nextLong();
        System.out.println((int)(Math.floor(Math.sqrt(n))+Math.floor(Math.cbrt(n)))-sqc(n));
      }
  }
  
  