





from typing import List

from ...processing_utils import ProcessorMixin
from ...utils import is_torch_available


if is_torch_available():
					import torch
class       UpperCamelCase_		(	_lowerCamelCase       ):
					lowerCAmelCase_				=						['''image_processor''', '''tokenizer''']
					lowerCAmelCase_				=						'''OneFormerImageProcessor'''
					lowerCAmelCase_				=						('''CLIPTokenizer''', '''CLIPTokenizerFast''')




					def __init__(		self					,    lowerCAmelCase_=None					,    lowerCAmelCase_=None					,    lowerCAmelCase_ = 77					,    lowerCAmelCase_ = 77					,    **lowerCAmelCase_	)		->				Union[str, Any]:
										if image_processor is None:
															raise ValueError('You need to specify an `image_processor`.'	)
										if tokenizer is None:
															raise ValueError('You need to specify a `tokenizer`.'	)

										_snake_case						=					max_seq_length
										_snake_case						=					task_seq_length

										super().__init__(lowerCAmelCase_					,    lowerCAmelCase_	)




					def 						lowerCAmelCase      (		self					,    lowerCAmelCase_=None					,    lowerCAmelCase_=77	)		->				Dict:
										if text_list is None:
															raise ValueError('tokens cannot be None.'	)

										_snake_case						=					self.tokenizer(lowerCAmelCase_					,    padding='max_length'					,    max_length=lowerCAmelCase_					,    truncation=lowerCAmelCase_	)

										_snake_case				,  _snake_case						=					tokens['attention_mask'], tokens['input_ids']

										_snake_case						=					[]
										for attn_mask, input_id in zip(lowerCAmelCase_					,    lowerCAmelCase_	):
															_snake_case						=					torch.tensor(lowerCAmelCase_	) * torch.tensor(lowerCAmelCase_	)
															token_inputs.append(token.unsqueeze(0	)	)

										_snake_case						=					torch.cat(lowerCAmelCase_					,    dim=0	)
										return token_inputs




					def __call__(		self					,    lowerCAmelCase_=None					,    lowerCAmelCase_=None					,    lowerCAmelCase_=None					,    **lowerCAmelCase_	)		->				Union[str, Any]:

										if task_inputs is None:
															raise ValueError('You have to specify the task_input. Found None.'	)
										elif images is None:
															raise ValueError('You have to specify the image. Found None.'	)

										if not all(task in ['semantic', 'instance', 'panoptic'] for task in task_inputs	):
															raise ValueError('task_inputs must be semantic, instance, or panoptic.'	)

										_snake_case						=					self.image_processor(lowerCAmelCase_					,    lowerCAmelCase_					,    lowerCAmelCase_					,    **lowerCAmelCase_	)

										if isinstance(lowerCAmelCase_					,    lowerCAmelCase_	):
															_snake_case						=					[task_inputs]

										if isinstance(lowerCAmelCase_					,    lowerCAmelCase_	) and all(isinstance(lowerCAmelCase_					,    lowerCAmelCase_	) for task_input in task_inputs	):
															_snake_case						=					[]
															for task in task_inputs:
																				_snake_case						=					F'''the task is {task}'''
																				task_token_inputs.append(lowerCAmelCase_	)
															_snake_case						=					self._preprocess_text(lowerCAmelCase_					,    max_length=self.task_seq_length	)
										else:
															raise TypeError('Task Inputs should be a string or a list of strings.'	)

										if hasattr(lowerCAmelCase_					,    'text_inputs'	):
															_snake_case						=					encoded_inputs.text_inputs

															_snake_case						=					[]
															for texts in texts_list:
																				_snake_case						=					self._preprocess_text(lowerCAmelCase_					,    max_length=self.max_seq_length	)
																				text_inputs.append(text_input_list.unsqueeze(0	)	)

															_snake_case						=					torch.cat(lowerCAmelCase_					,    dim=0	)

										return encoded_inputs




					def 						lowerCAmelCase      (		self					,    lowerCAmelCase_=None					,    lowerCAmelCase_=None					,    lowerCAmelCase_=None					,    **lowerCAmelCase_	)		->				Union[str, Any]:

										if task_inputs is None:
															raise ValueError('You have to specify the task_input. Found None.'	)
										elif images is None:
															raise ValueError('You have to specify the image. Found None.'	)

										if not all(task in ['semantic', 'instance', 'panoptic'] for task in task_inputs	):
															raise ValueError('task_inputs must be semantic, instance, or panoptic.'	)

										_snake_case						=					self.image_processor.encode_inputs(lowerCAmelCase_					,    lowerCAmelCase_					,    lowerCAmelCase_					,    **lowerCAmelCase_	)

										if isinstance(lowerCAmelCase_					,    lowerCAmelCase_	):
															_snake_case						=					[task_inputs]

										if isinstance(lowerCAmelCase_					,    lowerCAmelCase_	) and all(isinstance(lowerCAmelCase_					,    lowerCAmelCase_	) for task_input in task_inputs	):
															_snake_case						=					[]
															for task in task_inputs:
																				_snake_case						=					F'''the task is {task}'''
																				task_token_inputs.append(lowerCAmelCase_	)
															_snake_case						=					self._preprocess_text(lowerCAmelCase_					,    max_length=self.task_seq_length	)
										else:
															raise TypeError('Task Inputs should be a string or a list of strings.'	)

										if hasattr(lowerCAmelCase_					,    'text_inputs'	):
															_snake_case						=					encoded_inputs.text_inputs

															_snake_case						=					[]
															for texts in texts_list:
																				_snake_case						=					self._preprocess_text(lowerCAmelCase_					,    max_length=self.max_seq_length	)
																				text_inputs.append(text_input_list.unsqueeze(0	)	)

															_snake_case						=					torch.cat(lowerCAmelCase_					,    dim=0	)

										return encoded_inputs




					def 						lowerCAmelCase      (		self					,    *lowerCAmelCase_					,    **lowerCAmelCase_	)		->				int:
										return self.image_processor.post_process_semantic_segmentation(*lowerCAmelCase_					,    **lowerCAmelCase_	)




					def 						lowerCAmelCase      (		self					,    *lowerCAmelCase_					,    **lowerCAmelCase_	)		->				int:
										return self.image_processor.post_process_instance_segmentation(*lowerCAmelCase_					,    **lowerCAmelCase_	)






					def 						lowerCAmelCase      (		self					,    *lowerCAmelCase_					,    **lowerCAmelCase_	)		->				int:
										return self.image_processor.post_process_panoptic_segmentation(*lowerCAmelCase_					,    **lowerCAmelCase_	)










def     lowerCamelCase__  (  UpperCamelCase__      :							int = 100    )      ->			int:



					'''simple docstring'''




					_snake_case						=					1
					_snake_case						=					0
					for i in range(1							,     num + 1    ):
										fact *= i

					for j in str(UpperCamelCase__    ):
										result += int(UpperCamelCase__    )

					return result


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



