
'''simple docstring'''

import copy
from typing import TYPE_CHECKING, Any, Mapping, Optional, OrderedDict

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
from ..auto.configuration_auto import AutoConfig


if TYPE_CHECKING:
	from ... import PreTrainedTokenizerBase, TensorType

_UpperCAmelCase :   Tuple			    =	logging.get_logger(__name__)

class       UpperCAmelCase					(       lowercase_			):





		"""simple docstring"""





		A__	: str    =     'vision-encoder-decoder'
		A__	: Optional[int]    =     True
		def __init__(     self	,       **_snake_case  )					->     Tuple:
				super().__init__(**_lowercase  )
				if "encoder" not in kwargs or "decoder" not in kwargs:
						raise ValueError(
						    F'''A configuraton of type {self.model_type} cannot be instantiated because '''
						    F'''not both `encoder` and `decoder` sub-configurations are passed, but only {kwargs}'''  )

				_UpperCamelCase							:			int     =   kwargs.pop('''encoder'''  )
				_UpperCamelCase							:			List[Any]     =   encoder_config.pop('''model_type'''  )
				_UpperCamelCase							:			Dict     =   kwargs.pop('''decoder'''  )
				_UpperCamelCase							:			List[str]     =   decoder_config.pop('''model_type'''  )

				_UpperCamelCase							:			Tuple     =   AutoConfig.for_model(_lowercase	,       **_lowercase  )
				_UpperCamelCase							:			int     =   AutoConfig.for_model(_lowercase	,       **_lowercase  )
				_UpperCamelCase							:			List[Any]     =   True
		@classmethod
		def _lowercase	(     cls	,       _snake_case	,       _snake_case	,       **_snake_case  )					->     PretrainedConfig:
				logger.info('''Setting `config.is_decoder=True` and `config.add_cross_attention=True` for decoder_config'''  )
				_UpperCamelCase							:			Dict     =   True
				_UpperCamelCase							:			int     =   True

				return cls(encoder=encoder_config.to_dict()	,       decoder=decoder_config.to_dict()	,       **_lowercase  )




		def _lowercase	(     self  )					->     Union[str, Any]:
				_UpperCamelCase							:			Any     =   copy.deepcopy(self.__dict__  )
				_UpperCamelCase							:			Any     =   self.encoder.to_dict()
				_UpperCamelCase							:			Optional[Any]     =   self.decoder.to_dict()
				_UpperCamelCase							:			Optional[int]     =   self.__class__.model_type
				return output







class       UpperCAmelCase					(       lowercase_			):





		"""simple docstring"""





		A__	: Optional[int]    =     version.parse('1.11'			)
		@property
		def _lowercase	(     self  )					->     Mapping[str, Mapping[int, str]]:
				return OrderedDict(
				    [
				        ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
				    ]  )
		@property
		def _lowercase	(     self  )					->     float:
				return 1E-4




		@property
		def _lowercase	(     self  )					->     Mapping[str, Mapping[int, str]]:
				return OrderedDict({'''last_hidden_state''': {0: '''batch''', 1: '''encoder_sequence'''}}  )







class       UpperCAmelCase					(       lowercase_			):





		"""simple docstring"""





		@property
		def _lowercase	(     self  )					->     Mapping[str, Mapping[int, str]]:
				_UpperCamelCase							:			Optional[int]     =   OrderedDict()
				_UpperCamelCase							:			str     =   {0: '''batch''', 1: '''past_decoder_sequence + sequence'''}
				_UpperCamelCase							:			Any     =   {0: '''batch''', 1: '''past_decoder_sequence + sequence'''}
				_UpperCamelCase							:			List[str]     =   {0: '''batch''', 1: '''encoder_sequence'''}

				return common_inputs




		def _lowercase	(     self	,       _snake_case	,       _snake_case = -1	,       _snake_case = -1	,       _snake_case = False	,       _snake_case = None	,       )					->     Mapping[str, Any]:
				import torch

				_UpperCamelCase							:			str     =   OrderedDict()

				_UpperCamelCase							:			Tuple     =   super().generate_dummy_inputs(
				    _lowercase	,       batch_size=_lowercase	,       seq_length=_lowercase	,       is_pair=_lowercase	,       framework=_lowercase  )

				_UpperCamelCase,				_UpperCamelCase							:			Union[str, Any]     =   dummy_input['''input_ids'''].shape
				_UpperCamelCase							:			Any     =   (batch, encoder_sequence, self._config.encoder_hidden_size)
				_UpperCamelCase							:			Optional[Any]     =   dummy_input.pop('''input_ids'''  )
				_UpperCamelCase							:			Union[str, Any]     =   dummy_input.pop('''attention_mask'''  )
				_UpperCamelCase							:			Any     =   torch.zeros(_lowercase  )

				return common_inputs







class       UpperCAmelCase					(       lowercase_			):





		"""simple docstring"""





		@property
		def _lowercase	(     self  )					->     None:
				pass
		def _lowercase	(     self	,       _snake_case  )					->     OnnxConfig:
				return VisionEncoderDecoderEncoderOnnxConfig(_lowercase  )




		def _lowercase	(     self	,       _snake_case	,       _snake_case	,       _snake_case = "default"  )					->     OnnxConfig:
				_UpperCamelCase							:			Tuple     =   encoder_config.hidden_size
				return VisionEncoderDecoderDecoderOnnxConfig(_lowercase	,       _lowercase  )








'''simple docstring'''

from math import factorial




def 							_UpperCamelCase				(   lowerCAmelCase__:					int = 100   )      -> int:
							return sum(map(lowerCAmelCase__		,str(factorial(lowerCAmelCase__   )   )   )   )


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





