


'''simple docstring'''






import json
import os
from functools import lru_cache
from typing import TYPE_CHECKING, List, Optional, Tuple

import regex as re

from ...tokenization_utils import AddedToken, PreTrainedTokenizer
from ...utils import logging


if TYPE_CHECKING:
  from transformers.pipelines.conversational import Conversation

__A					:  Optional[int]											=      logging.get_logger(__name__)


__A					:  Optional[Any]											=      {
    "vocab_file": "vocab.json",
    "merges_file": "merges.txt",
    "tokenizer_config_file": "tokenizer_config.json",
}

__A					:  Tuple											=      {
    "vocab_file": {"facebook/blenderbot-3B": "https://huggingface.co/facebook/blenderbot-3B/resolve/main/vocab.json"},
    "merges_file": {"facebook/blenderbot-3B": "https://huggingface.co/facebook/blenderbot-3B/resolve/main/merges.txt"},
    "tokenizer_config_file": {
        "facebook/blenderbot-3B": "https://huggingface.co/facebook/blenderbot-3B/resolve/main/tokenizer_config.json"
    },
}

__A					:  str											=      {"facebook/blenderbot-3B": 128}







@lru_cache()
# Copied from transformers.models.roberta.tokenization_roberta.bytes_to_unicode
def 				UpperCamelCase_			(    ):
  '''simple docstring'''





  lowerCAmelCase_			:      Tuple			=   (
      list(range(ord("""!"""					)							,    ord("""~"""					) + 1					)					) + list(range(ord("""¡"""					)							,    ord("""¬"""					) + 1					)					) + list(range(ord("""®"""					)							,    ord("""ÿ"""					) + 1					)					)
  )
  lowerCAmelCase_			:      Optional[int]			=   bs[:]
  lowerCAmelCase_			:      str			=   0
  for b in range(2**8					):
    if b not in bs:
      bs.append(A__					)
      cs.append(2**8 + n					)
      n += 1
  lowerCAmelCase_			:      List[Any]			=   [chr(A__					) for n in cs]
  return dict(zip(A__							,    A__					)					)







def 				UpperCamelCase_			(    A__					:   Dict					):
  '''simple docstring'''





  lowerCAmelCase_			:      int			=   set()
  lowerCAmelCase_			:      Optional[int]			=   word[0]
  for char in word[1:]:
    pairs.add((prev_char, char)					)
    lowerCAmelCase_			:      Optional[int]			=   char
  return pairs






class    __snake_case       (   _SCREAMING_SNAKE_CASE):







    """simple docstring"""



    lowercase    =					VOCAB_FILES_NAMES
    lowercase    =					PRETRAINED_VOCAB_FILES_MAP
    lowercase    =					PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
    lowercase    =					['input_ids', 'attention_mask']

    def __init__(   self    :  List[Any]    ,						lowerCamelCase    :  int    ,						lowerCamelCase    :  Optional[Any]    ,						lowerCamelCase    :  Optional[int]="replace"    ,						lowerCamelCase    :  Dict="<s>"    ,						lowerCamelCase    :  Tuple="</s>"    ,						lowerCamelCase    :  Optional[Any]="</s>"    ,						lowerCamelCase    :  List[Any]="<s>"    ,						lowerCamelCase    :  List[str]="<unk>"    ,						lowerCamelCase    :  Optional[Any]="<pad>"    ,						lowerCamelCase    :  List[str]="<mask>"    ,						lowerCamelCase    :  List[Any]=False    ,						**lowerCamelCase    :  Optional[Any]    ,						)   ->  int:
      lowerCAmelCase_			:      Dict			=   AddedToken(lowerCamelCase    ,						lstrip=lowerCamelCase    ,						rstrip=lowerCamelCase		) if isinstance(lowerCamelCase    ,						lowerCamelCase		) else bos_token
      lowerCAmelCase_			:      int			=   AddedToken(lowerCamelCase    ,						lstrip=lowerCamelCase    ,						rstrip=lowerCamelCase		) if isinstance(lowerCamelCase    ,						lowerCamelCase		) else eos_token
      lowerCAmelCase_			:      List[str]			=   AddedToken(lowerCamelCase    ,						lstrip=lowerCamelCase    ,						rstrip=lowerCamelCase		) if isinstance(lowerCamelCase    ,						lowerCamelCase		) else sep_token
      lowerCAmelCase_			:      List[str]			=   AddedToken(lowerCamelCase    ,						lstrip=lowerCamelCase    ,						rstrip=lowerCamelCase		) if isinstance(lowerCamelCase    ,						lowerCamelCase		) else cls_token
      lowerCAmelCase_			:      List[Any]			=   AddedToken(lowerCamelCase    ,						lstrip=lowerCamelCase    ,						rstrip=lowerCamelCase		) if isinstance(lowerCamelCase    ,						lowerCamelCase		) else unk_token
      lowerCAmelCase_			:      Dict			=   AddedToken(lowerCamelCase    ,						lstrip=lowerCamelCase    ,						rstrip=lowerCamelCase		) if isinstance(lowerCamelCase    ,						lowerCamelCase		) else pad_token

      # Mask token behave like a normal word, i.e. include the space before it
      lowerCAmelCase_			:      Any			=   AddedToken(lowerCamelCase    ,						lstrip=lowerCamelCase    ,						rstrip=lowerCamelCase		) if isinstance(lowerCamelCase    ,						lowerCamelCase		) else mask_token

      super().__init__(
          errors=lowerCamelCase    ,						bos_token=lowerCamelCase    ,						eos_token=lowerCamelCase    ,						unk_token=lowerCamelCase    ,						sep_token=lowerCamelCase    ,						cls_token=lowerCamelCase    ,						pad_token=lowerCamelCase    ,						mask_token=lowerCamelCase    ,						add_prefix_space=lowerCamelCase    ,						**lowerCamelCase    ,						)

      with open(lowerCamelCase    ,						encoding="""utf-8"""		) as vocab_handle:
        lowerCAmelCase_			:      Optional[Any]			=   json.load(lowerCamelCase		)
      lowerCAmelCase_			:      Optional[Any]			=   {v: k for k, v in self.encoder.items()}
      lowerCAmelCase_			:      List[str]			=   errors  # how to handle errors in decoding
      lowerCAmelCase_			:      Dict			=   bytes_to_unicode()
      lowerCAmelCase_			:      int			=   {v: k for k, v in self.byte_encoder.items()}
      with open(lowerCamelCase    ,						encoding="""utf-8"""		) as merges_handle:
        lowerCAmelCase_			:      Optional[int]			=   merges_handle.read().split("""\n"""		)[1:-1]
      lowerCAmelCase_			:      Tuple			=   [tuple(merge.split()		) for merge in bpe_merges]
      lowerCAmelCase_			:      List[Any]			=   dict(zip(lowerCamelCase    ,						range(len(lowerCamelCase		)		)		)		)
      lowerCAmelCase_			:      int			=   {}
      lowerCAmelCase_			:      Any			=   add_prefix_space

      # Should have added re.IGNORECASE so BPE merges can happen for capitalized versions of contractions
      lowerCAmelCase_			:      int			=   re.compile(R"""'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+"""		)

    @property
    # Copied from transformers.models.roberta.tokenization_roberta.RobertaTokenizer.vocab_size with Roberta->Blenderbot, RoBERTa->Blenderbot
    def __lowercase   (   self    :  int		)   ->  Optional[int]:
      return len(self.encoder		)

    def __lowercase   (   self    :  Any		)   ->  List[str]:
      return dict(self.encoder    ,						**self.added_tokens_encoder		)

    def __lowercase   (   self    :  str    ,						lowerCamelCase    :  int		)   ->  str:
      if token in self.cache:
        return self.cache[token]
      lowerCAmelCase_			:      Optional[int]			=   tuple(lowerCamelCase		)
      lowerCAmelCase_			:      str			=   get_pairs(lowerCamelCase		)

      if not pairs:
        return token

      while True:
        lowerCAmelCase_			:      Dict			=   min(lowerCamelCase    ,						key=lambda lowerCamelCase		: self.bpe_ranks.get(lowerCamelCase    ,						float("""inf"""		)		)		)
        if bigram not in self.bpe_ranks:
          break
        lowerCAmelCase_,							lowerCAmelCase_			:      Tuple			=   bigram
        lowerCAmelCase_			:      int			=   []
        lowerCAmelCase_			:      Union[str, Any]			=   0
        while i < len(lowerCamelCase		):
          try:
            lowerCAmelCase_			:      List[Any]			=   word.index(lowerCamelCase    ,						lowerCamelCase		)
          except ValueError:
            new_word.extend(word[i:]		)
            break
          else:
            new_word.extend(word[i:j]		)
            lowerCAmelCase_			:      List[str]			=   j

          if word[i] == first and i < len(lowerCamelCase		) - 1 and word[i + 1] == second:
            new_word.append(first + second		)
            i += 2
          else:
            new_word.append(word[i]		)
            i += 1
        lowerCAmelCase_			:      Union[str, Any]			=   tuple(lowerCamelCase		)
        lowerCAmelCase_			:      Optional[Any]			=   new_word
        if len(lowerCamelCase		) == 1:
          break
        else:
          lowerCAmelCase_			:      Union[str, Any]			=   get_pairs(lowerCamelCase		)
      lowerCAmelCase_			:      int			=   """ """.join(lowerCamelCase		)
      lowerCAmelCase_			:      Union[str, Any]			=   word
      return word

    def __lowercase   (   self    :  List[Any]    ,						lowerCamelCase    :  Optional[Any]		)   ->  List[str]:
      lowerCAmelCase_			:      Dict			=   []
      for token in re.findall(self.pat    ,						lowerCamelCase		):
        lowerCAmelCase_			:      int			=   """""".join(
            self.byte_encoder[b] for b in token.encode("""utf-8"""		)		)  # Maps all our bytes to unicode strings, avoiding control tokens of the BPE (spaces in our case)
        bpe_tokens.extend(bpe_token for bpe_token in self.bpe(lowerCamelCase		).split(""" """		)		)
      return bpe_tokens

    def __lowercase   (   self    :  int    ,						lowerCamelCase    :  Tuple		)   ->  Optional[int]:
      return self.encoder.get(lowerCamelCase    ,						self.encoder.get(self.unk_token		)		)

    def __lowercase   (   self    :  Union[str, Any]    ,						lowerCamelCase    :  List[str]		)   ->  List[str]:
      return self.decoder.get(lowerCamelCase		)

    def __lowercase   (   self    :  Union[str, Any]    ,						lowerCamelCase    :  Any		)   ->  Optional[int]:
      lowerCAmelCase_			:      List[str]			=   """""".join(lowerCamelCase		)
      lowerCAmelCase_			:      Dict			=   bytearray([self.byte_decoder[c] for c in text]		).decode("""utf-8"""    ,						errors=self.errors		)
      return text

    def __lowercase   (   self    :  List[str]    ,						lowerCamelCase    :  str    ,						lowerCamelCase    :  Optional[str] = None		)   ->  Tuple[str]:
      if not os.path.isdir(lowerCamelCase		):
        logger.error(F'Vocabulary path ({save_directory}) should be a directory'		)
        return
      lowerCAmelCase_			:      Tuple			=   os.path.join(
          lowerCamelCase    ,						(filename_prefix + """-""" if filename_prefix else """""") + VOCAB_FILES_NAMES["""vocab_file"""]		)
      lowerCAmelCase_			:      Optional[int]			=   os.path.join(
          lowerCamelCase    ,						(filename_prefix + """-""" if filename_prefix else """""") + VOCAB_FILES_NAMES["""merges_file"""]		)

      with open(lowerCamelCase    ,						"""w"""    ,						encoding="""utf-8"""		) as f:
        f.write(json.dumps(self.encoder    ,						indent=2    ,						sort_keys=lowerCamelCase    ,						ensure_ascii=lowerCamelCase		) + """\n"""		)

      lowerCAmelCase_			:      Union[str, Any]			=   0
      with open(lowerCamelCase    ,						"""w"""    ,						encoding="""utf-8"""		) as writer:
        writer.write("""#version: 0.2\n"""		)
        for bpe_tokens, token_index in sorted(self.bpe_ranks.items()    ,						key=lambda lowerCamelCase		: kv[1]		):
          if index != token_index:
            logger.warning(
                F'Saving vocabulary to {merge_file}: BPE merge indices are not consecutive.'
                """ Please check that the tokenizer is not corrupted!"""		)
            lowerCAmelCase_			:      List[Any]			=   token_index
          writer.write(""" """.join(lowerCamelCase		) + """\n"""		)
          index += 1

      return vocab_file, merge_file

    def __lowercase   (   self    :  Dict    ,						lowerCamelCase    :  List[int]    ,						lowerCamelCase    :  Optional[List[int]] = None    ,						lowerCamelCase    :  bool = False		)   ->  List[int]:
      if already_has_special_tokens:
        return super().get_special_tokens_mask(
            token_ids_a=lowerCamelCase    ,						token_ids_a=lowerCamelCase    ,						already_has_special_tokens=lowerCamelCase		)

      if token_ids_a is None:
        return [1] + ([0] * len(lowerCamelCase		)) + [1]
      return [1] + ([0] * len(lowerCamelCase		)) + [1, 1] + ([0] * len(lowerCamelCase		)) + [1]

    def __lowercase   (   self    :  Optional[Any]    ,						lowerCamelCase    :  List[int]    ,						lowerCamelCase    :  Optional[List[int]] = None		)   ->  List[int]:
      lowerCAmelCase_			:      List[Any]			=   [self.sep_token_id]
      lowerCAmelCase_			:      List[str]			=   [self.cls_token_id]

      if token_ids_a is None:
        return len(cls + token_ids_a + sep		) * [0]
      return len(cls + token_ids_a + sep + sep + token_ids_a + sep		) * [0]

    def __lowercase   (   self    :  Any    ,						lowerCamelCase    :  Tuple    ,						lowerCamelCase    :  str=False    ,						**lowerCamelCase    :  Tuple		)   ->  Union[str, Any]:
      lowerCAmelCase_			:      int			=   kwargs.pop("""add_prefix_space"""    ,						self.add_prefix_space		)
      if (is_split_into_words or add_prefix_space) and (len(lowerCamelCase		) > 0 and not text[0].isspace()):
        lowerCAmelCase_			:      Any			=   """ """ + text
      return (text, kwargs)

    def __lowercase   (   self    :  Any    ,						lowerCamelCase    :  List[int]    ,						lowerCamelCase    :  Optional[List[int]] = None		)   ->  List[Any]:
      return token_ids_a + [self.eos_token_id]





    def __lowercase   (   self    :  Dict    ,						lowerCamelCase    :  "Conversation"		)   ->  List[int]:
      lowerCAmelCase_			:      Any			=   []
      for is_user, text in conversation.iter_texts():
        if is_user:
          # We need to space prefix as it's being done within blenderbot
          inputs.append(""" """ + text		)
        else:
          # Generated responses should contain them already.
          inputs.append(lowerCamelCase		)

      lowerCAmelCase_			:      List[Any]			=   """  """.join(lowerCamelCase		)
      lowerCAmelCase_			:      List[str]			=   self.encode(lowerCamelCase		)
      if len(lowerCamelCase		) > self.model_max_length:
        lowerCAmelCase_			:      List[str]			=   input_ids[-self.model_max_length :]
        logger.warning(F'Trimmed input from conversation as it was longer than {self.model_max_length} tokens.'		)
      return input_ids







'''simple docstring'''






def 				UpperCamelCase_			(    A__					:   int = 1_00					):
  '''simple docstring'''





  lowerCAmelCase_			:      int			=   set()

  lowerCAmelCase_			:      Tuple			=   0

  lowerCAmelCase_			:      str			=   n + 1  # maximum limit

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


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



