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.IOException;
  import java.io.OutputStream;
  import java.io.InputStream;
  import java.io.PrintWriter;
  import java.io.BufferedReader;
  import java.io.InputStreamReader;
  import java.util.*;
  
  /*
   * I referred to Petr's input / output template
   */
  public class Main {
      public static void main(String[] args) {
          InputStream inputStream = System.in;
          OutputStream outputStream = System.out;
          InputReader in = new InputReader(inputStream);
          PrintWriter out = new PrintWriter(outputStream);
          TaskB solver = new TaskB();
          int testCount = in.nextInt();
          for (int i = 1; i <= testCount; i++)
              solver.solve(i, in, out);
          out.close();
      }
  
      static class TaskB {
          static final int MAX_ARRAY_SIZE = 100_000_000;
          static final long INF = 0x1fffffffffffffffL;
          static final int IINF = 0x3fffffff;
          static final long MOD = 1000000007;
  
          public void solve(int testNumber, InputReader in, PrintWriter out) {
              int n = in.nextInt();
              Set<Integer> set = new HashSet<>();
              int i = 1;
              while (i * i <= n) {
                  set.add(i * i);
                  ++i;
              }
              i = 1;
              while (i * i * i <= n) {
                  set.add(i * i * i);
                  ++i;
              }
              List<Integer> list = new ArrayList<>(set);
              Collections.sort(list);
  //            int lowerBound = ~Collections.binarySearch(list, n,
  //                    new LowerBoundComparator<>());
              int upperBound = ~Collections.binarySearch(list, n,
                      new UpperBoundComparator<>());
  //            System.out.println(upperBound);
  //            System.out.println(lowerBound);
              System.out.println(upperBound);
  
              // end solve
          }
      }
  
      static class LowerBoundComparator<T extends Comparable<? super T>>
              implements Comparator<T>
      {
          public int compare(T x, T y)
          {
              return (x.compareTo(y) >= 0) ? 1 : -1;
          }
      }
  
      static class UpperBoundComparator<T extends Comparable<? super T>>
              implements Comparator<T>
      {
          public int compare(T x, T y)
          {
              return (x.compareTo(y) > 0) ? 1 : -1;
          }
      }
  
      static class InputReader {
          public BufferedReader reader;
          public StringTokenizer tokenizer;
  
          public InputReader(InputStream stream) {
              reader = new BufferedReader(new InputStreamReader(stream), 32768);
              tokenizer = null;
          }
  
          public String next() {
              while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                  try {
                      tokenizer = new StringTokenizer(reader.readLine());
                  } catch (IOException e) {
                      throw new RuntimeException(e);
                  }
              }
              return tokenizer.nextToken();
          }
  
          public int nextInt() { return Integer.parseInt(next()); }
  
          public int[] arrayInt(int N) {
              int[] arr = new int[N];
              for (int i = 0; i < N; i++) {
                  arr[i] = nextInt();
              }
              return arr;
          }
  
          public int[][] matrixInt(int H, int W) {
              int[][] matrix = new int[H][W];
              for (int i = 0; i < H; i++) {
                  for (int j = 0; j < W; j++) {
                      matrix[i][j] = nextInt();
                  }
              }
              return matrix;
          }
  
          public long nextLong() {
              return Long.parseLong(next());
          }
  
          public long[] arrayLong(int N) {
              long[] arr = new long[N];
              for (int i = 0; i < N; i++) {
                  arr[i] = nextInt();
              }
              return arr;
          }
  
          public long[][] matrixLong(int H, int W) {
              long[][] matrix = new long[H][W];
              for (int i = 0; i < H; i++) {
                  for (int j = 0; j < W; j++) {
                      matrix[i][j] = nextLong();
                  }
              }
              return matrix;
          }
  
          public double nextDouble() {
              return Double.parseDouble(next());
          }
  
          public double[] arrayDouble(int N) {
              double[] arr = new double[N];
              for (int i = 0; i < N; i++) {
                  arr[i] = nextDouble();
              }
              return arr;
          }
  
          public double[][] matrixDouble(int H, int W) {
              double[][] matrix = new double[H][W];
              for (int i = 0; i < H; i++) {
                  for (int j = 0; j < W; j++) {
                      matrix[i][j] = nextDouble();
                  }
              }
              return matrix;
          }
      }
  }
  