
import math
import sys




def    __UpperCamelCase     (				lowerCAmelCase__							:				int  ):
 if number != int(lowerCAmelCase__  ):
  raise ValueError('''the value of input must be a natural number'''  )
 if number < 0:
  raise ValueError('''the value of input must not be a negative number'''  )
 if number == 0:
  return 1
 __a :  Any						=  [-1] * (number + 1)
 __a :  Dict						=  0
 for i in range(1  ,   number + 1  ):
  __a :  Any						=  sys.maxsize
  __a :  str						=  int(math.sqrt(lowerCAmelCase__  )  )
  for j in range(1  ,   root + 1  ):
   __a :  Any						=  1 + answers[i - (j**2)]
   __a :  List[Any]						=  min(lowerCAmelCase__  ,   lowerCAmelCase__  )
  __a :  Dict						=  answer
 return answers[number]


if __name__ == "__main__":
      import doctest

      doctest.testmod()


def    __UpperCamelCase     (				lowerCAmelCase__							:				int = 5_0_0_0_0_0_0_0  ):
 __a :  int						=  set()
 __a :  str						=  int((limit - 2_4) ** (1 / 2)  )

 __a :  int						=  set(range(3  ,   prime_square_limit + 1  ,   2  )  )
 primes.add(2  )
 for p in range(3  ,   prime_square_limit + 1  ,   2  ):
  if p not in primes:
   continue
  primes.difference_update(set(range(p * p  ,   prime_square_limit + 1  ,   lowerCAmelCase__  )  )  )

 for primea in primes:
  __a :  Union[str, Any]						=  primea * primea
  for primea in primes:
   __a :  Union[str, Any]						=  primea * primea * primea
   if square + cube >= limit - 1_6:
    break
   for primea in primes:
    __a :  int						=  primea * primea * primea * primea
    __a :  Union[str, Any]						=  square + cube + tetr
    if total >= limit:
     break
    ret.add(lowerCAmelCase__  )

 return len(lowerCAmelCase__  )


if __name__ == "__main__":
      print(F"""{solution() = }""")
