from collections import Counter
import datasets
import transformers
from transformers.convert_slow_tokenizer import SLOW_TO_FAST_CONVERTERS

from transformers.utils import logging

logging.set_verbosity_info()

snake_case__						      =			{
    name: (getattr(transformers, name), getattr(transformers, name + 'Fast')) for name in SLOW_TO_FAST_CONVERTERS
}

snake_case__						      =			datasets.load_dataset('xnli', split='test+validation')

snake_case__						      =			0
snake_case__						      =			0
snake_case__						      =			0
snake_case__						      =			0
def    __magic_name__(	__UpperCAmelCase			,    __UpperCAmelCase			,    __UpperCAmelCase			,    __UpperCAmelCase		)    ->     Dict:



      '''simple docstring'''

      if spm_diff == list(reversed(lowercase__		)		):
            # AAA -> AA+A vs A+AA case.
            return True
      elif len(lowercase__		) == len(lowercase__		) and fast.decode(lowercase__		) == fast.decode(lowercase__		):
            # Second order OK
            # Barrich -> Barr + ich vs Bar + rich
            return True
      _lowerCamelCase           =					slow.encode(slow.decode(lowercase__		)		)
      _lowerCamelCase           =					fast.encode(fast.decode(lowercase__		)		)
      if spm_reencoded != spm_diff and spm_reencoded == tok_reencoded:
            # Type 3 error.
            # Snehagatha ->
            #       Sne, h, aga, th, a
            #       Sne, ha, gat, ha
            # Encoding the wrong with sp does not even recover what spm gave us
            # It fits tokenizer however...
            return True
      return False
def    __magic_name__(	__UpperCAmelCase			,    __UpperCAmelCase			,    __UpperCAmelCase		)    ->     Union[str, Any]:



      '''simple docstring'''

      _lowerCamelCase           =					fast.encode_plus(lowercase__		)[0]
      _lowerCamelCase           =					enc.offsets
      _lowerCamelCase     ,       _lowerCamelCase           =					offsets[idx], offsets[idx - 1]
      if curr is not None and line[curr[0] : curr[1]] == "\u200f":
            return True
      if prev is not None and line[prev[0] : prev[1]] == "\u200f":
            return True
def    __magic_name__(	__UpperCAmelCase			,    __UpperCAmelCase			,    __UpperCAmelCase			,    __UpperCAmelCase			,    __UpperCAmelCase		)    ->     Union[str, Any]:



      '''simple docstring'''

      for i, (spm_id, tok_id) in enumerate(zip(lowercase__			,    lowercase__		)		):
            if spm_id != tok_id:
                  break
      _lowerCamelCase           =					i
      for i, (spm_id, tok_id) in enumerate(zip(reversed(lowercase__		)			,    reversed(lowercase__		)		)		):
            if spm_id != tok_id:
                  break
      _lowerCamelCase           =					len(lowercase__		) - i

      _lowerCamelCase           =					spm_ids[first:last]
      _lowerCamelCase           =					tok_ids[first:last]

      if check_diff(lowercase__			,    lowercase__			,    lowercase__			,    lowercase__		):
            return True

      if check_LTR_mark(lowercase__			,    lowercase__			,    lowercase__		):
            return True

      if last - first > 5:
            # We might have twice a single problem, attempt to subdivide the disjointed tokens into smaller problems
            _lowerCamelCase           =					Counter(spm_ids[first:last]		)
            _lowerCamelCase           =					Counter(tok_ids[first:last]		)

            _lowerCamelCase           =					{spm_ for (spm_, si) in spms.items() if toks.get(spm_			,    0		) == si}
            _lowerCamelCase           =					3
            for i in range(last - first - min_width		):
                  if all(spm_ids[first + i + j] in removable_tokens for j in range(lowercase__		)		):
                        _lowerCamelCase           =					[
                            k
                            for k in range(last - first - min_width		)
                            if tok_ids[first + k : first + k + min_width] == spm_ids[first + i : first + i + min_width]
                        ]
                        for j in possible_matches:
                              if check_diff(spm_ids[first : first + i]			,    tok_ids[first : first + j]			,    lowercase__			,    lowercase__		) and check_details(
                                  lowercase__			,    spm_ids[first + i : last]			,    tok_ids[first + j : last]			,    lowercase__			,    lowercase__			,    ):
                                    return True

      print(F'Spm: {[fast.decode([spm_ids[i]]		) for i in range(lowercase__			,    lowercase__		)]}'		)
      try:
            print(F'Tok: {[fast.decode([tok_ids[i]]		) for i in range(lowercase__			,    lowercase__		)]}'		)
      except Exception:
            pass

      _lowerCamelCase           =					fast.decode(spm_ids[:first]		)
      _lowerCamelCase           =					fast.decode(spm_ids[last:]		)
      _lowerCamelCase           =					fast.decode(spm_ids[first:last]		)
      print()
      print(lowercase__		)
      return False
def    __magic_name__(	__UpperCAmelCase			,    __UpperCAmelCase			,    __UpperCAmelCase		)    ->     Tuple:



      '''simple docstring'''

      global perfect
      global imperfect
      global wrong
      global total

      _lowerCamelCase           =					slow.encode(lowercase__		)
      _lowerCamelCase           =					fast.encode(lowercase__		)

      _lowerCamelCase           =					False
      total += 1

      if slow_ids != fast_ids:
            if check_details(lowercase__			,    lowercase__			,    lowercase__			,    lowercase__			,    lowercase__		):
                  _lowerCamelCase           =					True
                  imperfect += 1
            else:
                  wrong += 1
      else:
            perfect += 1

      if total % 1_0000 == 0:
            print(F'({perfect} / {imperfect} / {wrong} ----- {perfect + imperfect + wrong})'		)

      if skip_assert:
            return

      assert (
          slow_ids == fast_ids
      ), F'line {text} : \n\n{slow_ids}\n{fast_ids}\n\n{slow.tokenize(lowercase__		)}\n{fast.tokenize(lowercase__		)}'
def    __magic_name__(	__UpperCAmelCase			,    __UpperCAmelCase		)    ->     Union[str, Any]:



      '''simple docstring'''

      global batch_total
      for i in range(len(lowercase__		)		):
            # premise, all languages
            for text in dataset[i]["premise"].values():
                  test_string(lowercase__			,    lowercase__			,    lowercase__		)

            # hypothesis, all languages
            for text in dataset[i]["hypothesis"]["translation"]:
                  test_string(lowercase__			,    lowercase__			,    lowercase__		)


if __name__ == "__main__":
     for name, (slow_class, fast_class) in TOKENIZER_CLASSES.items():
          snake_case__						      =			list(slow_class.max_model_input_sizes.keys())
          for checkpoint in checkpoint_names:
               snake_case__						      =			0
               snake_case__						      =			0
               snake_case__						      =			0
               snake_case__						      =			0

               print(f'''========================== Checking {name}: {checkpoint} ==========================''')
               snake_case__						      =			slow_class.from_pretrained(checkpoint, force_download=True)
               snake_case__						      =			fast_class.from_pretrained(checkpoint, force_download=True)
               test_tokenizer(slow, fast)
               print(f'''Accuracy {perfect * 100 / total:.2f}''')



from math import floor, sqrt

def 		snake_case_   (				lowercase__     :    int     ):






				'''simple docstring'''






				_lowerCAmelCase  						=0.0
				_lowerCAmelCase  						=1.0
				_lowerCAmelCase  						=int(sqrt(lowercase__     )     )
				_lowerCAmelCase  						=root
				_lowerCAmelCase  						=0
				while integer_part != 2 * root:
								_lowerCAmelCase  						=denominator * integer_part - numerator
								_lowerCAmelCase  						=(n - numerator**2) / denominator
								_lowerCAmelCase  						=int((root + numerator) / denominator     )
								period += 1
				return period

def 		snake_case_   (				lowercase__     :    int = 1_00_00     ):






				'''simple docstring'''






				_lowerCAmelCase  						=0
				for i in range(2       ,     n + 1     ):
								_lowerCAmelCase  						=sqrt(lowercase__     )
								if sr - floor(lowercase__     ) != 0 and continuous_fraction_period(lowercase__     ) % 2 == 1:
												count_odd_periods += 1
				return count_odd_periods


if __name__ == "__main__":
		print(F'{solution(int(input().strip()))}')

