


"""simple docstring"""





from math import factorial


def    _snake_case  (  _snake_case :	int = 100	):
      return sum(int(_snake_case	) for x in str(factorial(_snake_case	)	)	)


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



import json
import os
import unittest

from transformers import BatchEncoding, LEDTokenizer, LEDTokenizerFast
from transformers.models.led.tokenization_led import VOCAB_FILES_NAMES
from transformers.testing_utils import require_tokenizers, require_torch
from transformers.utils import cached_property

from ...test_tokenization_common import TokenizerTesterMixin



@require_tokenizers
class   snake_case_       (		__A  ,unittest.TestCase       ):
   __A	:		Union[str, Any]         =				LEDTokenizer
   __A	:		Union[str, Any]         =				LEDTokenizerFast
   __A	:		Optional[Any]         =				True






   def       __UpperCamelCase     (      self				:     List[str]  )					->						Union[str, Any]:
       super().setUp()
       lowercase__ :   List[str]    					=				[
           "l",
           "o",
           "w",
           "e",
           "r",
           "s",
           "t",
           "i",
           "d",
           "n",
           "\u0120",
           "\u0120l",
           "\u0120n",
           "\u0120lo",
           "\u0120low",
           "er",
           "\u0120lowest",
           "\u0120newer",
           "\u0120wider",
           "<unk>",
       ]
       lowercase__ :   Optional[int]    					=				dict(zip(lowercase_	,						range(len(lowercase_  )  )  )  )
       lowercase__ :   str    					=				["#version: 0.2", "\u0120 l", "\u0120l o", "\u0120lo w", "e r", ""]
       lowercase__ :   Tuple    					=				{"unk_token": "<unk>"}

       lowercase__ :   Optional[Any]    					=				os.path.join(self.tmpdirname	,						VOCAB_FILES_NAMES["vocab_file"]  )
       lowercase__ :   Dict    					=				os.path.join(self.tmpdirname	,						VOCAB_FILES_NAMES["merges_file"]  )
       with open(self.vocab_file	,						"w"	,						encoding="utf-8"  ) as fp:
           fp.write(json.dumps(lowercase_  ) + "\n"  )
       with open(self.merges_file	,						"w"	,						encoding="utf-8"  ) as fp:
           fp.write("\n".join(lowercase_  )  )






   def       __UpperCamelCase     (      self				:     int	,						**lowercase_				:     str  )					->						List[Any]:
       kwargs.update(self.special_tokens_map  )
       return self.tokenizer_class.from_pretrained(self.tmpdirname	,						**lowercase_  )






   def       __UpperCamelCase     (      self				:     List[Any]	,						**lowercase_				:     Any  )					->						List[Any]:
       kwargs.update(self.special_tokens_map  )
       return self.rust_tokenizer_class.from_pretrained(self.tmpdirname	,						**lowercase_  )






   def       __UpperCamelCase     (      self				:     str	,						lowercase_				:     Any  )					->						Tuple:
       return "lower newer", "lower newer"






   @cached_property
   def       __UpperCamelCase     (      self				:     Tuple  )					->						Optional[Any]:
       return LEDTokenizer.from_pretrained("allenai/led-base-16384"  )






   @cached_property
   def       __UpperCamelCase     (      self				:     Tuple  )					->						int:
       return LEDTokenizerFast.from_pretrained("allenai/led-base-16384"  )






   @require_torch
   def       __UpperCamelCase     (      self				:     int  )					->						List[Any]:
       lowercase__ :   Union[str, Any]    					=				["A long paragraph for summarization.", "Another paragraph for summarization."]
       lowercase__ :   str    					=				[0, 2_50, 2_51, 1_78_18, 13, 3_91_86, 19_38, 4, 2]

       for tokenizer in [self.default_tokenizer, self.default_tokenizer_fast]:
           lowercase__ :   Dict    					=				tokenizer(lowercase_	,						max_length=len(lowercase_  )	,						padding=lowercase_	,						return_tensors="pt"  )
           self.assertIsInstance(lowercase_	,						lowercase_  )

           self.assertEqual((2, 9)	,						batch.input_ids.shape  )
           self.assertEqual((2, 9)	,						batch.attention_mask.shape  )
           lowercase__ :   Union[str, Any]    					=				batch.input_ids.tolist()[0]
           self.assertListEqual(lowercase_	,						lowercase_  )






   @require_torch
   def       __UpperCamelCase     (      self				:     List[str]  )					->						Tuple:
       lowercase__ :   Dict    					=				["A long paragraph for summarization.", "Another paragraph for summarization."]
       for tokenizer in [self.default_tokenizer, self.default_tokenizer_fast]:
           lowercase__ :   Optional[int]    					=				tokenizer(lowercase_	,						padding=lowercase_	,						return_tensors="pt"  )
           self.assertIn("input_ids"	,						lowercase_  )
           self.assertIn("attention_mask"	,						lowercase_  )
           self.assertNotIn("labels"	,						lowercase_  )
           self.assertNotIn("decoder_attention_mask"	,						lowercase_  )






   @require_torch
   def       __UpperCamelCase     (      self				:     Optional[Any]  )					->						Any:
       lowercase__ :   Dict    					=				[
           "Summary of the text.",
           "Another summary.",
       ]
       for tokenizer in [self.default_tokenizer, self.default_tokenizer_fast]:
           lowercase__ :   Dict    					=				tokenizer(text_target=lowercase_	,						max_length=32	,						padding="max_length"	,						return_tensors="pt"  )
           self.assertEqual(32	,						targets["input_ids"].shape[1]  )






   @require_torch
   def       __UpperCamelCase     (      self				:     Optional[int]  )					->						Tuple:
       for tokenizer in [self.default_tokenizer, self.default_tokenizer_fast]:
           lowercase__ :   int    					=				tokenizer(
               ["I am a small frog" * 10_24, "I am a small frog"]	,						padding=lowercase_	,						truncation=lowercase_	,						return_tensors="pt"  )
           self.assertIsInstance(lowercase_	,						lowercase_  )
           self.assertEqual(batch.input_ids.shape	,						(2, 51_22)  )






   @require_torch
   def       __UpperCamelCase     (      self				:     List[str]  )					->						Any:
       lowercase__ :   Union[str, Any]    					=				["A long paragraph for summarization."]
       lowercase__ :   List[Any]    					=				[
           "Summary of the text.",
       ]
       for tokenizer in [self.default_tokenizer, self.default_tokenizer_fast]:
           lowercase__ :   List[Any]    					=				tokenizer(lowercase_	,						return_tensors="pt"  )
           lowercase__ :   Dict    					=				tokenizer(text_target=lowercase_	,						return_tensors="pt"  )
           lowercase__ :   Optional[int]    					=				inputs["input_ids"]
           lowercase__ :   str    					=				targets["input_ids"]
           self.assertTrue((input_ids[:, 0] == tokenizer.bos_token_id).all().item()  )
           self.assertTrue((labels[:, 0] == tokenizer.bos_token_id).all().item()  )
           self.assertTrue((input_ids[:, -1] == tokenizer.eos_token_id).all().item()  )
           self.assertTrue((labels[:, -1] == tokenizer.eos_token_id).all().item()  )






   @require_torch
   def       __UpperCamelCase     (      self				:     Union[str, Any]  )					->						Dict:
       for tokenizer in [self.default_tokenizer, self.default_tokenizer_fast]:
           lowercase__ :   int    					=				["Summary of the text.", "Another summary."]
           lowercase__ :   List[str]    					=				[[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -1, -1]]

           lowercase__ :   Tuple    					=				tokenizer(lowercase_	,						padding=lowercase_  )
           lowercase__ :   int    					=				[[0] * len(lowercase_  ) for x in encoded_output["input_ids"]]
           lowercase__ :   Any    					=				tokenizer.pad(lowercase_  )
           self.assertSequenceEqual(outputs["global_attention_mask"]	,						lowercase_  )






   def       __UpperCamelCase     (      self				:     int  )					->						Union[str, Any]:
       pass







   def       __UpperCamelCase     (      self				:     int  )					->						Optional[Any]:
       for tokenizer, pretrained_name, kwargs in self.tokenizers_list:
           with self.subTest(F'''{tokenizer.__class__.__name__} ({pretrained_name})'''  ):
               lowercase__ :   List[Any]    					=				self.rust_tokenizer_class.from_pretrained(lowercase_	,						**lowercase_  )
               lowercase__ :   List[str]    					=				self.tokenizer_class.from_pretrained(lowercase_	,						**lowercase_  )
               lowercase__ :   List[Any]    					=				"A, <mask> AllenNLP sentence."
               lowercase__ :   Tuple    					=				tokenizer_r.encode_plus(lowercase_	,						add_special_tokens=lowercase_	,						return_token_type_ids=lowercase_  )
               lowercase__ :   List[str]    					=				tokenizer_p.encode_plus(lowercase_	,						add_special_tokens=lowercase_	,						return_token_type_ids=lowercase_  )
               self.assertEqual(sum(tokens_r["token_type_ids"]  )	,						sum(tokens_p["token_type_ids"]  )  )
               self.assertEqual(
                   sum(tokens_r["attention_mask"]  ) / len(tokens_r["attention_mask"]  )	,						sum(tokens_p["attention_mask"]  ) / len(tokens_p["attention_mask"]  )	,						)

               lowercase__ :   Any    					=				tokenizer_r.convert_ids_to_tokens(tokens_r["input_ids"]  )
               lowercase__ :   Optional[Any]    					=				tokenizer_p.convert_ids_to_tokens(tokens_p["input_ids"]  )
               self.assertSequenceEqual(tokens_p["input_ids"]	,						[0, 2_50, 6, 5_02_64, 38_23, 4_87, 2_19_92, 36_45, 4, 2]  )
               self.assertSequenceEqual(tokens_r["input_ids"]	,						[0, 2_50, 6, 5_02_64, 38_23, 4_87, 2_19_92, 36_45, 4, 2]  )

               self.assertSequenceEqual(
                   lowercase_	,						["<s>", "A", ",", "<mask>", "ĠAllen", "N", "LP", "Ġsentence", ".", "</s>"]  )
               self.assertSequenceEqual(
                   lowercase_	,						["<s>", "A", ",", "<mask>", "ĠAllen", "N", "LP", "Ġsentence", ".", "</s>"]  )



