
from typing import List, Union

from ..utils import (
    add_end_docstrings,
    is_tf_available,
    is_torch_available,
    is_vision_available,
    logging,
    requires_backends,
)
from .base import PIPELINE_INIT_ARGS, Pipeline


if is_vision_available():
     from PIL import Image

     from ..image_utils import load_image

if is_tf_available():
     import tensorflow as tf

     from ..models.auto.modeling_tf_auto import TF_MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING
     from ..tf_utils import stable_softmax

if is_torch_available():
     from ..models.auto.modeling_auto import MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING

__magic_name__            =  logging.get_logger(__name__)




@add_end_docstrings(__UpperCamelCase )
class 					_SCREAMING_SNAKE_CASE  (      __UpperCamelCase ):
      def __init__(			self		,	*lowerCamelCase		,	**lowerCamelCase ):
          super().__init__(*lowerCamelCase		,	**lowerCamelCase )
          requires_backends(self		,	"vision" )
          self.check_model_type(
              TF_MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING
              if self.framework == "tf"
              else MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING )
      def A_			(			self		,	lowerCamelCase=None ):
          snake_case__						=				{}
          if top_k is not None:
              snake_case__						=				top_k
          return {}, {}, postprocess_params
      def __call__(			self		,	lowerCamelCase		,	**lowerCamelCase ):
          return super().__call__(lowerCamelCase		,	**lowerCamelCase )
      def A_			(			self		,	lowerCamelCase ):
          snake_case__						=				load_image(lowerCamelCase )
          snake_case__						=				self.image_processor(images=lowerCamelCase		,	return_tensors=self.framework )
          return model_inputs
      def A_			(			self		,	lowerCamelCase ):
          snake_case__						=				self.model(**lowerCamelCase )
          return model_outputs



      def A_			(			self		,	lowerCamelCase		,	lowerCamelCase=5 ):
          if top_k > self.model.config.num_labels:
              snake_case__						=				self.model.config.num_labels

          if self.framework == "pt":
              snake_case__						=				model_outputs.logits.softmax(-1 )[0]
              snake_case__						,					snake_case__						=				probs.topk(lowerCamelCase )
          elif self.framework == "tf":
              snake_case__						=				stable_softmax(model_outputs.logits		,	axis=-1 )[0]
              snake_case__						=				tf.math.top_k(lowerCamelCase		,	k=lowerCamelCase )
              snake_case__						,					snake_case__						=				topk.values.numpy(), topk.indices.numpy()
          else:
              raise ValueError(F"""Unsupported framework: {self.framework}""" )

          snake_case__						=				scores.tolist()
          snake_case__						=				ids.tolist()
          return [{"score": score, "label": self.model.config.idalabel[_id]} for score, _id in zip(lowerCamelCase		,	lowerCamelCase )]





from math import factorial





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


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



