


import json
import os
import tempfile
import unittest
import unittest.mock as mock
from pathlib import Path

from requests.exceptions import HTTPError

from transformers.utils import (
    CONFIG_NAME,
    FLAX_WEIGHTS_NAME,
    TF2_WEIGHTS_NAME,
    TRANSFORMERS_CACHE,
    WEIGHTS_NAME,
    cached_file,
    get_file_from_repo,
    has_file,
)


lowerCamelCase__							:						Tuple							     =   """hf-internal-testing/tiny-random-bert"""
lowerCamelCase__							:						Tuple							     =   os.path.join(TRANSFORMERS_CACHE, """models--hf-internal-testing--tiny-random-bert""")
lowerCamelCase__							:						Optional[int]							     =   """9b8c223d42b2188cb49d29af482996f9d0f3e5a6"""
class 		__magic_name__						(unittest.TestCase				):





     '''simple docstring'''



     def 	SCREAMING_SNAKE_CASE__						(					self:Dict   ):
       snake_case__						= cached_file(_a     ,		_a   )
       # Should have downloaded the file in here
       self.assertTrue(os.path.isdir(_a   )   )
       # Cache should contain at least those three subfolders:
       for subfolder in ["blobs", "refs", "snapshots"]:
         self.assertTrue(os.path.isdir(os.path.join(_a     ,		_a   )   )   )
       with open(os.path.join(_a     ,		'''refs'''     ,		'''main'''   )   ) as f:
         snake_case__						= f.read()
       self.assertEqual(_a     ,		os.path.join(_a     ,		'''snapshots'''     ,		_a     ,		_a   )   )
       self.assertTrue(os.path.isfile(_a   )   )

       # File is cached at the same place the second time.
       snake_case__						= cached_file(_a     ,		_a   )
       self.assertEqual(_a     ,		_a   )

       # Using a specific revision to test the full commit hash.
       snake_case__						= cached_file(_a     ,		_a     ,		revision='''9b8c223'''   )
       self.assertEqual(_a     ,		os.path.join(_a     ,		'''snapshots'''     ,		_a     ,		_a   )   )

     def 	SCREAMING_SNAKE_CASE__						(					self:Union[str, Any]   ):
       with self.assertRaisesRegex(_a     ,		'''is not a valid model identifier'''   ):
         snake_case__						= cached_file('''tiny-random-bert'''     ,		_a   )

       with self.assertRaisesRegex(_a     ,		'''is not a valid git identifier'''   ):
         snake_case__						= cached_file(_a     ,		_a     ,		revision='''aaaa'''   )

       with self.assertRaisesRegex(_a     ,		'''does not appear to have a file named'''   ):
         snake_case__						= cached_file(_a     ,		'''conf'''   )

     def 	SCREAMING_SNAKE_CASE__						(					self:List[str]   ):
       with self.assertRaisesRegex(_a     ,		'''does not appear to have a file named'''   ):
         snake_case__						= cached_file(_a     ,		'''conf'''   )

       with open(os.path.join(_a     ,		'''refs'''     ,		'''main'''   )   ) as f:
         snake_case__						= f.read()
       self.assertTrue(os.path.isfile(os.path.join(_a     ,		'''.no_exist'''     ,		_a     ,		'''conf'''   )   )   )

       snake_case__						= cached_file(_a     ,		'''conf'''     ,		_raise_exceptions_for_missing_entries=_a   )
       self.assertIsNone(_a   )

       snake_case__						= cached_file(_a     ,		'''conf'''     ,		local_files_only=_a     ,		_raise_exceptions_for_missing_entries=_a   )
       self.assertIsNone(_a   )

       snake_case__						= mock.Mock()
       snake_case__						= 5_00
       snake_case__						= {}
       snake_case__						= HTTPError
       snake_case__						= {}

       # Under the mock environment we get a 500 error when trying to reach the tokenizer.
       with mock.patch('''requests.Session.request'''     ,		return_value=_a   ) as mock_head:
         snake_case__						= cached_file(_a     ,		'''conf'''     ,		_raise_exceptions_for_connection_errors=_a   )
         self.assertIsNone(_a   )
         # This check we did call the fake head request
         mock_head.assert_called()

     def 	SCREAMING_SNAKE_CASE__						(					self:Any   ):
       self.assertTrue(has_file('''hf-internal-testing/tiny-bert-pt-only'''     ,		_a   )   )
       self.assertFalse(has_file('''hf-internal-testing/tiny-bert-pt-only'''     ,		_a   )   )
       self.assertFalse(has_file('''hf-internal-testing/tiny-bert-pt-only'''     ,		_a   )   )

     def 	SCREAMING_SNAKE_CASE__						(					self:Optional[Any]   ):
       # `get_file_from_repo` returns None if the file does not exist
       self.assertIsNone(get_file_from_repo('''bert-base-cased'''     ,		'''ahah.txt'''   )   )

       # The function raises if the repository does not exist.
       with self.assertRaisesRegex(_a     ,		'''is not a valid model identifier'''   ):
         get_file_from_repo('''bert-base-case'''     ,		_a   )

       # The function raises if the revision does not exist.
       with self.assertRaisesRegex(_a     ,		'''is not a valid git identifier'''   ):
         get_file_from_repo('''bert-base-cased'''     ,		_a     ,		revision='''ahaha'''   )

       snake_case__						= get_file_from_repo('''bert-base-cased'''     ,		_a   )
       # The name is the cached name which is not very easy to test, so instead we load the content.
       snake_case__						= json.loads(open(_a     ,		'''r'''   ).read()   )
       self.assertEqual(config['''hidden_size''']     ,		7_68   )







     def 	SCREAMING_SNAKE_CASE__						(					self:List[str]   ):
       with tempfile.TemporaryDirectory() as tmp_dir:
         snake_case__						= Path(_a   ) / '''a.txt'''
         filename.touch()
         self.assertEqual(get_file_from_repo(_a     ,		'''a.txt'''   )     ,		str(_a   )   )

         self.assertIsNone(get_file_from_repo(_a     ,		'''b.txt'''   )   )





def SCREAMING_SNAKE_CASE	(			__lowerCAmelCase = 100				)    ->				int:
  snake_case__						= set()

  snake_case__						= 0

  snake_case__						= n + 1  # maximum limit

  for a in range(2							,   __lowerCAmelCase				):
    for b in range(2							,   __lowerCAmelCase				):
      snake_case__						= a**b  # calculates the current power
      collect_powers.add(__lowerCAmelCase				)  # adds the result to the set
  return len(__lowerCAmelCase				)


if __name__ == "__main__":
   print("""Number of terms """, solution(int(str(input()).strip())))

