output_description: Print the largest perfect power that is at most X.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      X
attempt: from fractions import gcd
  
  # from datetime import date, timedelta
  # from heapq import *
  import heapq
  import math
  from collections import defaultdict, Counter, deque
  from bisect import *
  import itertools
  import fractions
  import sys
  
  sys.setrecursionlimit(10**7)
  MOD = 10**9 + 7
  # input = sys.stdin.readline
  
  
  def lcm(a, b):
      return a * b / fractions.gcd(a, b)
  
  
  def make_divisors(n):
      divisors = []
      for i in range(1, int(n**0.5) + 1):
          if n % i == 0:
              divisors.append(i)
              if i != n // i:
                  divisors.append(n // i)
  
      # divisors.sort()
      return divisors
  
  
  def factorize(n):
      fct = []  # prime factor
      b, e = 2, 0  # base, exponent
      while b * b <= n:
          while n % b == 0:
              n = n // b
              e = e + 1
          if e > 0:
              fct.append((b, e))
          b, e = b + 1, 0
      if n > 1:
          fct.append((n, 1))
      return fct
  
  
  def is_prime(n):
      if n == 1:
          return False
  
      for k in range(2, int(math.sqrt(n)) + 1):
          if n % k == 0:
              return False
  
      return True
  
  
  def primes(n):
      is_prime = [True] * (n + 1)
      is_prime[0] = False
      is_prime[1] = False
      for i in range(2, int(n**0.5) + 1):
          if not is_prime[i]:
              continue
          for j in range(i * 2, n + 1, i):
              is_prime[j] = False
      return [i for i in range(n + 1) if is_prime[i]]
  
  
  def modpow(a, n, mod):
      res = 1
      while n > 0:
          if n & 1:
              res = res * a % mod
          a = a * a % mod
          n >>= 1
      return res
  
  
  def modinv(a, mod):
      return modpow(a, mod - 2, mod)
  
  
  def cnk(a, b):
      MOD = 10**9 + 7
      ret = 1
      for i in range(b):
          ret *= a - i
          ret %= MOD
          ret = ret * modinv(i + 1, MOD) % MOD
      return ret
  
  
  def main():
      x = int(input())
      v = 1
      for i in range(1, 10000):
          if x <= i * i:
              print((i - 1) * (i - 1))
              exit()
  
  
  if __name__ == "__main__":
      main()
  
problem_description: Statement
  
  You are given a positive integer X. Find the largest _perfect power_ that is
  at most X. Here, a perfect power is an integer that can be represented as b^p,
  where b is an integer not less than 1 and p is an integer not less than 2.
samples: [{"input": "10", "output": "9\n    \n\nThere are four perfect powers that are at most 10: 1, 4, 8 and 9. We should\nprint the largest among them, 9.\n\n* * *"}, {"input": "1", "output": "1\n    \n\n* * *"}, {"input": "999", "output": "961"}]