

"""simple docstring"""


import json
from typing import Dict, List, Optional, Tuple, Union

from tokenizers import pre_tokenizers, processors

from ...tokenization_utils_base import AddedToken, BatchEncoding, EncodedInput
from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import PaddingStrategy, logging
from .tokenization_led import LEDTokenizer


__A						   =			logging.get_logger(__name__)


__A						   =			{"vocab_file": "vocab.json", "merges_file": "merges.txt", "tokenizer_file": "tokenizer.json"}

__A						   =			{
    "vocab_file": {
        "allenai/led-base-16384": "https://huggingface.co/allenai/led-base-16384/resolve/main/vocab.json",
    },
    "merges_file": {
        "allenai/led-base-16384": "https://huggingface.co/allenai/led-base-16384/resolve/main/merges.txt",
    },
    "tokenizer_file": {
        "allenai/led-base-16384": "https://huggingface.co/allenai/led-base-16384/resolve/main/tokenizer.json",
    },
}

__A						   =			{
    "allenai/led-base-16384": 16384,
}





class     snake_case	(				__snake_case  ):
				SCREAMING_SNAKE_CASE_   :      List[Any]         =  VOCAB_FILES_NAMES
				SCREAMING_SNAKE_CASE_   :      Dict         =  PRETRAINED_VOCAB_FILES_MAP
				SCREAMING_SNAKE_CASE_   :      List[str]         =  PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
				SCREAMING_SNAKE_CASE_   :      Union[str, Any]         =  LEDTokenizer
				SCREAMING_SNAKE_CASE_   :      Any         =  ["""input_ids""", """attention_mask"""]

				def __init__(	self							:				Optional[int]     ,  UpperCamelCase__							:				Any=None     ,  UpperCamelCase__							:				int=None     ,  UpperCamelCase__							:				Dict=None     ,  UpperCamelCase__							:				List[str]="replace"     ,  UpperCamelCase__							:				Optional[int]="<s>"     ,  UpperCamelCase__							:				List[str]="</s>"     ,  UpperCamelCase__							:				Optional[int]="</s>"     ,  UpperCamelCase__							:				List[Any]="<s>"     ,  UpperCamelCase__							:				Tuple="<unk>"     ,  UpperCamelCase__							:				Any="<pad>"     ,  UpperCamelCase__							:				Optional[int]="<mask>"     ,  UpperCamelCase__							:				Union[str, Any]=False     ,  UpperCamelCase__							:				str=True     ,  **UpperCamelCase__							:				List[Any]     ,  )->   List[Any]:



						'''simple docstring'''


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

						__lowerCAmelCase:       Dict          =			json.loads(self.backend_tokenizer.pre_tokenizer.__getstate__())
						if pre_tok_state.get("add_prefix_space"     ,  UpperCamelCase__) != add_prefix_space:
								__lowerCAmelCase:       Tuple          =			getattr(UpperCamelCase__     ,  pre_tok_state.pop("type"))
								__lowerCAmelCase:       List[Any]          =			add_prefix_space
								__lowerCAmelCase:       Any          =			pre_tok_class(**UpperCamelCase__)

						__lowerCAmelCase:       int          =			add_prefix_space

						# the pre_tokenizer is already updated in the GPT2TokenizerFast `__init__`
						__lowerCAmelCase:       List[str]          =			"post_processor"
						__lowerCAmelCase:       Optional[int]          =			getattr(self.backend_tokenizer     ,  UpperCamelCase__     ,  UpperCamelCase__)
						if tokenizer_component_instance:
								__lowerCAmelCase:       Optional[int]          =			json.loads(tokenizer_component_instance.__getstate__())

								# The lists 'sep' and 'cls' must be cased in tuples for the object `post_processor_class`
								if "sep" in state:
										__lowerCAmelCase:       Any          =			tuple(state["sep"])
								if "cls" in state:
										__lowerCAmelCase:       str          =			tuple(state["cls"])

								__lowerCAmelCase:       Dict          =			False

								if state.get("add_prefix_space"     ,  UpperCamelCase__) != add_prefix_space:
										__lowerCAmelCase:       Any          =			add_prefix_space
										__lowerCAmelCase:       Optional[int]          =			True

								if state.get("trim_offsets"     ,  UpperCamelCase__) != trim_offsets:
										__lowerCAmelCase:       Optional[Any]          =			trim_offsets
										__lowerCAmelCase:       Optional[Any]          =			True

								if changes_to_apply:
										__lowerCAmelCase:       Optional[int]          =			getattr(UpperCamelCase__     ,  state.pop("type"))
										__lowerCAmelCase:       int          =			component_class(**UpperCamelCase__)
										setattr(self.backend_tokenizer     ,  UpperCamelCase__     ,  UpperCamelCase__)

				@property
				# Copied from transformers.models.bart.tokenization_bart_fast.BartTokenizerFast.mask_token with BART->LED
				def 							lowercase_     (	self							:				Tuple)->   str:



						'''simple docstring'''


						if self._mask_token is None:
								if self.verbose:
										logger.error("Using mask_token, but it is not set yet.")
								return None
						return str(self._mask_token)

				@mask_token.setter
				def 							lowercase_     (	self							:				int     ,  UpperCamelCase__							:				Optional[int])->   Tuple:



						'''simple docstring'''


						__lowerCAmelCase:       int          =			AddedToken(UpperCamelCase__     ,  lstrip=UpperCamelCase__     ,  rstrip=UpperCamelCase__) if isinstance(UpperCamelCase__     ,  UpperCamelCase__) else value
						__lowerCAmelCase:       int          =			value

				def 							lowercase_     (	self							:				Union[str, Any]     ,  *UpperCamelCase__							:				List[str]     ,  **UpperCamelCase__							:				Optional[Any])->   BatchEncoding:



						'''simple docstring'''


						__lowerCAmelCase:       Tuple          =			kwargs.get("is_split_into_words"     ,  UpperCamelCase__)

						if is_split_into_words and not self.add_prefix_space:
								raise ValueError(
								    f"You need to instantiate {self.__class__.__name__} with add_prefix_space=True "
								    "to use it with pretokenized inputs.")

						return super()._batch_encode_plus(*UpperCamelCase__     ,  **UpperCamelCase__)

				def 							lowercase_     (	self							:				Dict     ,  *UpperCamelCase__							:				Union[str, Any]     ,  **UpperCamelCase__							:				Optional[Any])->   BatchEncoding:



						'''simple docstring'''


						__lowerCAmelCase:       Optional[int]          =			kwargs.get("is_split_into_words"     ,  UpperCamelCase__)

						if is_split_into_words and not self.add_prefix_space:
								raise ValueError(
								    f"You need to instantiate {self.__class__.__name__} with add_prefix_space=True "
								    "to use it with pretokenized inputs.")

						return super()._encode_plus(*UpperCamelCase__     ,  **UpperCamelCase__)

				def 							lowercase_     (	self							:				List[Any]     ,  UpperCamelCase__							:				str     ,  UpperCamelCase__							:				Optional[str] = None)->   Tuple[str]:



						'''simple docstring'''


						__lowerCAmelCase:       Tuple          =			self._tokenizer.model.save(UpperCamelCase__     ,  name=UpperCamelCase__)
						return tuple(UpperCamelCase__)

				def 							lowercase_     (	self							:				List[str]     ,  UpperCamelCase__							:				List[Any]     ,  UpperCamelCase__							:				Union[str, Any]=None)->   Optional[Any]:



						'''simple docstring'''


						__lowerCAmelCase:       Tuple          =			[self.bos_token_id] + token_ids_a + [self.eos_token_id]
						if token_ids_a is None:
								return output

						return output + [self.eos_token_id] + token_ids_a + [self.eos_token_id]

				def 							lowercase_     (	self							:				int     ,  UpperCamelCase__							:				List[int]     ,  UpperCamelCase__							:				Optional[List[int]] = None)->   List[int]:



						'''simple docstring'''


						__lowerCAmelCase:       Optional[int]          =			[self.sep_token_id]
						__lowerCAmelCase:       int          =			[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							:				str     ,  UpperCamelCase__							:				Union[Dict[str, EncodedInput], BatchEncoding]     ,  UpperCamelCase__							:				Optional[int] = None     ,  UpperCamelCase__							:				PaddingStrategy = PaddingStrategy.DO_NOT_PAD     ,  UpperCamelCase__							:				Optional[int] = None     ,  UpperCamelCase__							:				Optional[bool] = None     ,  )->   dict:



						'''simple docstring'''


						__lowerCAmelCase:       Optional[int]          =			super()._pad(
						    encoded_inputs=UpperCamelCase__     ,  max_length=UpperCamelCase__     ,  padding_strategy=UpperCamelCase__     ,  pad_to_multiple_of=UpperCamelCase__     ,  return_attention_mask=UpperCamelCase__     ,  )

						# Load from model defaults
						if return_attention_mask is None:
								__lowerCAmelCase:       List[str]          =			"attention_mask" in self.model_input_names

						if return_attention_mask and "global_attention_mask" in encoded_inputs:
								__lowerCAmelCase:       str          =			encoded_inputs[self.model_input_names[0]]
								# `global_attention_mask` need to have the same length as other (sequential) inputs.
								__lowerCAmelCase:       Union[str, Any]          =			len(encoded_inputs["global_attention_mask"]) != len(UpperCamelCase__)

								if needs_to_be_padded:
										__lowerCAmelCase:       str          =			len(UpperCamelCase__) - len(encoded_inputs["global_attention_mask"])

										if self.padding_side == "right":
												# Use `-1` since `0` in `global_attention_mask` means `local attention` instead of `not to attend`
												__lowerCAmelCase:       Any          =			(
												    encoded_inputs["global_attention_mask"] + [-1] * difference
												)
										elif self.padding_side == "left":
												__lowerCAmelCase:       str          =			[-1] * difference + encoded_inputs[
												    "global_attention_mask"
												]
										else:
												raise ValueError("Invalid padding strategy:" + str(self.padding_side))

						return encoded_inputs





"""simple docstring"""


def     a__    (    __SCREAMING_SNAKE_CASE )	->	int:
		__lowerCAmelCase:       Optional[Any]          =			1
		for i in range(1					, num + 1 ):
				fact *= i
		return fact






def     a__    (    __SCREAMING_SNAKE_CASE )	->	int:
		__lowerCAmelCase:       List[str]          =			0
		while number > 0:
				__lowerCAmelCase:       Any          =			number % 1_0
				sum_of_digits += last_digit
				__lowerCAmelCase:       List[Any]          =			number // 1_0  # Removing the last_digit from the given number
		return sum_of_digits






def     a__    (    __SCREAMING_SNAKE_CASE = 1_0_0 )	->	int:
		__lowerCAmelCase:       Tuple          =			factorial(__SCREAMING_SNAKE_CASE )
		__lowerCAmelCase:       Optional[int]          =			split_and_add(__SCREAMING_SNAKE_CASE )
		return result


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


