






'''simple docstring'''
import os
import re
from shutil import copyfile
from typing import Any, Dict, List, Optional, Tuple

import sentencepiece as spm

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


a_					=	logging.get_logger(__name__)

a_					=	{'vocab_file': 'spiece.model'}

a_					=	{
    'vocab_file': {
        'google/bigbird-roberta-base': 'https://huggingface.co/google/bigbird-roberta-base/resolve/main/spiece.model',
        'google/bigbird-roberta-large': (
            'https://huggingface.co/google/bigbird-roberta-large/resolve/main/spiece.model'
        ),
        'google/bigbird-base-trivia-itc': (
            'https://huggingface.co/google/bigbird-base-trivia-itc/resolve/main/spiece.model'
        ),
    }
}

a_					=	{
    'google/bigbird-roberta-base': 4_0_9_6,
    'google/bigbird-roberta-large': 4_0_9_6,
    'google/bigbird-base-trivia-itc': 4_0_9_6,
}






class        __SCREAMING_SNAKE_CASE (     lowerCamelCase			):
 snake_case_												=							VOCAB_FILES_NAMES
 snake_case_												=							PRETRAINED_VOCAB_FILES_MAP
 snake_case_												=							PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
 snake_case_												=							["""input_ids""", """attention_mask"""]
 snake_case_												=							[]




 def __init__( self		:							int   , __lowercase		:							Any   , __lowercase		:							Tuple="<unk>"   , __lowercase		:							Tuple="<s>"   , __lowercase		:							Any="</s>"   , __lowercase		:							List[Any]="<pad>"   , __lowercase		:							Optional[int]="[SEP]"   , __lowercase		:							Dict="[MASK]"   , __lowercase		:							str="[CLS]"   , __lowercase		:							Optional[Dict[str, Any]] = None   , **__lowercase		:							Dict   , )		->  None:
       SCREAMING_SNAKE_CASE__       :			Optional[Any]													=AddedToken(__lowercase   , lstrip=__lowercase   , rstrip=__lowercase ) if isinstance(__lowercase   , __lowercase ) else bos_token
       SCREAMING_SNAKE_CASE__       :			List[Any]													=AddedToken(__lowercase   , lstrip=__lowercase   , rstrip=__lowercase ) if isinstance(__lowercase   , __lowercase ) else eos_token
       SCREAMING_SNAKE_CASE__       :			List[str]													=AddedToken(__lowercase   , lstrip=__lowercase   , rstrip=__lowercase ) if isinstance(__lowercase   , __lowercase ) else unk_token
       SCREAMING_SNAKE_CASE__       :			Optional[Any]													=AddedToken(__lowercase   , lstrip=__lowercase   , rstrip=__lowercase ) if isinstance(__lowercase   , __lowercase ) else pad_token
       SCREAMING_SNAKE_CASE__       :			Optional[int]													=AddedToken(__lowercase   , lstrip=__lowercase   , rstrip=__lowercase ) if isinstance(__lowercase   , __lowercase ) else cls_token
       SCREAMING_SNAKE_CASE__       :			Optional[Any]													=AddedToken(__lowercase   , lstrip=__lowercase   , rstrip=__lowercase ) if isinstance(__lowercase   , __lowercase ) else sep_token

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

       SCREAMING_SNAKE_CASE__       :			Tuple													={} if sp_model_kwargs is None else sp_model_kwargs

       super().__init__(
           bos_token=__lowercase   , eos_token=__lowercase   , unk_token=__lowercase   , pad_token=__lowercase   , sep_token=__lowercase   , mask_token=__lowercase   , cls_token=__lowercase   , sp_model_kwargs=self.sp_model_kwargs   , **__lowercase   , )

       SCREAMING_SNAKE_CASE__       :			int													=vocab_file

       SCREAMING_SNAKE_CASE__       :			Optional[Any]													=spm.SentencePieceProcessor(**self.sp_model_kwargs )
       self.sp_model.Load(__lowercase )




 @property
 def        __magic_name__		( self		:							Optional[int] )		->  str:
       return self.sp_model.get_piece_size()




 def        __magic_name__		( self		:							Any )		->  int:
       SCREAMING_SNAKE_CASE__       :			Union[str, Any]													={self.convert_ids_to_tokens(__lowercase ): i for i in range(self.vocab_size )}
       vocab.update(self.added_tokens_encoder )
       return vocab




 def __getstate__( self		:							Dict )		->  int:
       SCREAMING_SNAKE_CASE__       :			Optional[Any]													=self.__dict__.copy()
       SCREAMING_SNAKE_CASE__       :			List[str]													=None
       return state




 def __setstate__( self		:							Any   , __lowercase		:							Optional[int] )		->  Optional[int]:
       SCREAMING_SNAKE_CASE__       :			Union[str, Any]													=d

       # for backward compatibility
       if not hasattr(self   , '''sp_model_kwargs''' ):
             SCREAMING_SNAKE_CASE__       :			Tuple													={}

       SCREAMING_SNAKE_CASE__       :			int													=spm.SentencePieceProcessor(**self.sp_model_kwargs )
       self.sp_model.Load(self.vocab_file )




 def        __magic_name__		( self		:							Optional[Any]   , __lowercase		:							str )		->  List[str]:
       return self.sp_model.encode(__lowercase   , out_type=__lowercase )




 def        __magic_name__		( self		:							Any   , __lowercase		:							Any )		->  List[Any]:
       return self.sp_model.piece_to_id(__lowercase )




 def        __magic_name__		( self		:							str   , __lowercase		:							List[Any] )		->  Optional[Any]:
       SCREAMING_SNAKE_CASE__       :			List[Any]													=self.sp_model.IdToPiece(__lowercase )
       return token




 def        __magic_name__		( self		:							int   , __lowercase		:							Union[str, Any] )		->  Tuple:
       SCREAMING_SNAKE_CASE__       :			Tuple													=[]
       SCREAMING_SNAKE_CASE__       :			Optional[int]													=''''''
       SCREAMING_SNAKE_CASE__       :			Tuple													=False
       for token in tokens:
             # make sure that special tokens are not decoded using sentencepiece model
             if token in self.all_special_tokens:
                   if not prev_is_special:
                         out_string += " "
                   out_string += self.sp_model.decode(__lowercase ) + token
                   SCREAMING_SNAKE_CASE__       :			Any													=True
                   SCREAMING_SNAKE_CASE__       :			Optional[int]													=[]
             else:
                   current_sub_tokens.append(__lowercase )
                   SCREAMING_SNAKE_CASE__       :			str													=False
       out_string += self.sp_model.decode(__lowercase )
       return out_string.strip()




 def        __magic_name__		( self		:							int   , __lowercase		:							List[int]   , __lowercase		:							bool = False   , __lowercase		:							bool = None   , __lowercase		:							bool = True   , **__lowercase		:							List[Any]   , )		->  str:
       SCREAMING_SNAKE_CASE__       :			List[Any]													=kwargs.pop('''use_source_tokenizer'''   , __lowercase )

       SCREAMING_SNAKE_CASE__       :			Dict													=self.convert_ids_to_tokens(__lowercase   , skip_special_tokens=__lowercase )

       # To avoid mixing byte-level and unicode for byte-level BPT
       # we need to build string separately for added tokens and byte-level tokens
       # cf. https://github.com/huggingface/transformers/issues/1133
       SCREAMING_SNAKE_CASE__       :			List[Any]													=[]
       SCREAMING_SNAKE_CASE__       :			List[Any]													=[]
       for token in filtered_tokens:
             if skip_special_tokens and token in self.all_special_ids:
                   continue
             if token in self.added_tokens_encoder:
                   if current_sub_text:
                         sub_texts.append(self.convert_tokens_to_string(__lowercase ) )
                         SCREAMING_SNAKE_CASE__       :			Optional[int]													=[]
                   sub_texts.append(__lowercase )
             else:
                   current_sub_text.append(__lowercase )
       if current_sub_text:
             sub_texts.append(self.convert_tokens_to_string(__lowercase ) )

       # Mimic the behavior of the Rust tokenizer:
       # No space before [MASK] and [SEP]
       if spaces_between_special_tokens:
             SCREAMING_SNAKE_CASE__       :			Union[str, Any]													=re.sub(r''' (\[(MASK|SEP)\])'''   , r'''\1'''   , ''' '''.join(__lowercase ) )
       else:
             SCREAMING_SNAKE_CASE__       :			Union[str, Any]													=''''''.join(__lowercase )

       SCREAMING_SNAKE_CASE__       :			Any													=(
           clean_up_tokenization_spaces
           if clean_up_tokenization_spaces is not None
           else self.clean_up_tokenization_spaces
       )
       if clean_up_tokenization_spaces:
             SCREAMING_SNAKE_CASE__       :			Any													=self.clean_up_tokenization(__lowercase )
             return clean_text
       else:
             return text




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

       if os.path.abspath(self.vocab_file ) != os.path.abspath(__lowercase ) and os.path.isfile(self.vocab_file ):
             copyfile(self.vocab_file   , __lowercase )
       elif not os.path.isfile(self.vocab_file ):
             with open(__lowercase   , '''wb''' ) as fi:
                   SCREAMING_SNAKE_CASE__       :			Union[str, Any]													=self.sp_model.serialized_model_proto()
                   fi.write(__lowercase )

       return (out_vocab_file,)




 def        __magic_name__		( self		:							Optional[Any]   , __lowercase		:							List[int]   , __lowercase		:							Optional[List[int]] = None )		->  List[int]:
       if token_ids_a is None:
             return [self.cls_token_id] + token_ids_a + [self.sep_token_id]
       SCREAMING_SNAKE_CASE__       :			Tuple													=[self.cls_token_id]
       SCREAMING_SNAKE_CASE__       :			List[str]													=[self.sep_token_id]
       return cls + token_ids_a + sep + token_ids_a + sep




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

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




 def        __magic_name__		( self		:							Union[str, Any]   , __lowercase		:							List[int]   , __lowercase		:							Optional[List[int]] = None )		->  List[int]:
       SCREAMING_SNAKE_CASE__       :			List[str]													=[self.sep_token_id]
       SCREAMING_SNAKE_CASE__       :			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 ) * [0] + len(token_ids_a + sep ) * [1]







'''simple docstring'''
from math import factorial





def 	_a(					UpperCamelCase__			:  int = 1_0_0							):




      '''simple docstring'''






      return sum(int(UpperCamelCase__							) for x in str(factorial(UpperCamelCase__							)							)							)


if __name__ == "__main__":
  print(solution(int(input('Enter the Number: ').strip())))