





"""simple docstring"""


def        lowercase__     (       lowercase_      )       ->		int:




      """simple docstring"""

      _UpperCamelCase   :						Optional[int]    =							1
      for i in range(1		,num + 1      ):
            fact *= i
      return fact




def        lowercase__     (       lowercase_      )       ->		int:




      """simple docstring"""

      _UpperCamelCase   :						Tuple    =							0
      while number > 0:
            _UpperCamelCase   :						Tuple    =							number % 10
            sum_of_digits += last_digit
            _UpperCamelCase   :						Union[str, Any]    =							number // 10  # Removing the last_digit from the given number
      return sum_of_digits




def        lowercase__     (       lowercase_ = 100      )       ->		int:




      """simple docstring"""

      _UpperCamelCase   :						int    =							factorial(lowercase_      )
      _UpperCamelCase   :						Union[str, Any]    =							split_and_add(lowercase_      )
      return result


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







"""simple docstring"""


from typing import Any, Callable, Dict, List, Optional, Union

import torch
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer

from diffusers import (
    AutoencoderKL,
    DDIMScheduler,
    DiffusionPipeline,
    LMSDiscreteScheduler,
    PNDMScheduler,
    StableDiffusionPipeline,
    UNetaDConditionModel,
)
from diffusers.pipelines.stable_diffusion import StableDiffusionPipelineOutput
from diffusers.pipelines.stable_diffusion.safety_checker import StableDiffusionSafetyChecker


lowerCamelCase__						= "CompVis/stable-diffusion-v1-1"
lowerCamelCase__						= "CompVis/stable-diffusion-v1-2"
lowerCamelCase__						= "CompVis/stable-diffusion-v1-3"
lowerCamelCase__						= "CompVis/stable-diffusion-v1-4"



class   __SCREAMING_SNAKE_CASE     (    _UpperCamelCase ):







  '''simple docstring'''


  def __init__(		self :							Union[str, Any]       , __a :							AutoencoderKL       , __a :							CLIPTextModel       , __a :							CLIPTokenizer       , __a :							UNetaDConditionModel       , __a :							Union[DDIMScheduler, PNDMScheduler, LMSDiscreteScheduler]       , __a :							StableDiffusionSafetyChecker       , __a :							CLIPImageProcessor       , __a :							bool = True       , )		->					List[str]:
        super()._init_()

        _UpperCamelCase   :						Optional[int]    =							StableDiffusionPipeline.from_pretrained(__a						)
        _UpperCamelCase   :						int    =							StableDiffusionPipeline.from_pretrained(__a						)
        _UpperCamelCase   :						List[Any]    =							StableDiffusionPipeline.from_pretrained(__a						)
        _UpperCamelCase   :						int    =							StableDiffusionPipeline(
            vae=__a       , text_encoder=__a       , tokenizer=__a       , unet=__a       , scheduler=__a       , safety_checker=__a       , feature_extractor=__a       , requires_safety_checker=__a       , )

        self.register_modules(pipelinea=self.pipea       , pipelinea=self.pipea       , pipelinea=self.pipea       , pipelinea=self.pipea						)

  @property
  def  __SCREAMING_SNAKE_CASE					(		self :							Optional[int]						)		->					Dict[str, Any]:
        return {k: getattr(self       , __a						) for k in self.config.keys() if not k.startswith("_"						)}

  def  __SCREAMING_SNAKE_CASE					(		self :							Any       , __a :							Optional[Union[str, int]] = "auto"						)		->					Optional[Any]:
        if slice_size == "auto":
              # half the attention head size is usually a good trade-off between
              # speed and memory
              _UpperCamelCase   :						Tuple    =							self.unet.config.attention_head_dim // 2
        self.unet.set_attention_slice(__a						)

  def  __SCREAMING_SNAKE_CASE					(		self :							str						)		->					Any:
        self.enable_attention_slicing(__a						)

  @torch.no_grad()
  def  __SCREAMING_SNAKE_CASE					(		self :							List[str]       , __a :							Union[str, List[str]]       , __a :							int = 512       , __a :							int = 512       , __a :							int = 50       , __a :							float = 7.5       , __a :							Optional[Union[str, List[str]]] = None       , __a :							Optional[int] = 1       , __a :							float = 0.0       , __a :							Optional[torch.Generator] = None       , __a :							Optional[torch.FloatTensor] = None       , __a :							Optional[str] = "pil"       , __a :							bool = True       , __a :							Optional[Callable[[int, int, torch.FloatTensor], None]] = None       , __a :							int = 1       , **__a :							Any       , )		->					Optional[int]:
        return self.pipea(
            prompt=__a       , height=__a       , width=__a       , num_inference_steps=__a       , guidance_scale=__a       , negative_prompt=__a       , num_images_per_prompt=__a       , eta=__a       , generator=__a       , latents=__a       , output_type=__a       , return_dict=__a       , callback=__a       , callback_steps=__a       , **__a       , )

  @torch.no_grad()
  def  __SCREAMING_SNAKE_CASE					(		self :							List[Any]       , __a :							Union[str, List[str]]       , __a :							int = 512       , __a :							int = 512       , __a :							int = 50       , __a :							float = 7.5       , __a :							Optional[Union[str, List[str]]] = None       , __a :							Optional[int] = 1       , __a :							float = 0.0       , __a :							Optional[torch.Generator] = None       , __a :							Optional[torch.FloatTensor] = None       , __a :							Optional[str] = "pil"       , __a :							bool = True       , __a :							Optional[Callable[[int, int, torch.FloatTensor], None]] = None       , __a :							int = 1       , **__a :							Tuple       , )		->					str:
        return self.pipea(
            prompt=__a       , height=__a       , width=__a       , num_inference_steps=__a       , guidance_scale=__a       , negative_prompt=__a       , num_images_per_prompt=__a       , eta=__a       , generator=__a       , latents=__a       , output_type=__a       , return_dict=__a       , callback=__a       , callback_steps=__a       , **__a       , )

  @torch.no_grad()
  def  __SCREAMING_SNAKE_CASE					(		self :							List[Any]       , __a :							Union[str, List[str]]       , __a :							int = 512       , __a :							int = 512       , __a :							int = 50       , __a :							float = 7.5       , __a :							Optional[Union[str, List[str]]] = None       , __a :							Optional[int] = 1       , __a :							float = 0.0       , __a :							Optional[torch.Generator] = None       , __a :							Optional[torch.FloatTensor] = None       , __a :							Optional[str] = "pil"       , __a :							bool = True       , __a :							Optional[Callable[[int, int, torch.FloatTensor], None]] = None       , __a :							int = 1       , **__a :							Tuple       , )		->					Any:
        return self.pipea(
            prompt=__a       , height=__a       , width=__a       , num_inference_steps=__a       , guidance_scale=__a       , negative_prompt=__a       , num_images_per_prompt=__a       , eta=__a       , generator=__a       , latents=__a       , output_type=__a       , return_dict=__a       , callback=__a       , callback_steps=__a       , **__a       , )

  @torch.no_grad()
  def  __SCREAMING_SNAKE_CASE					(		self :							Dict       , __a :							Union[str, List[str]]       , __a :							int = 512       , __a :							int = 512       , __a :							int = 50       , __a :							float = 7.5       , __a :							Optional[Union[str, List[str]]] = None       , __a :							Optional[int] = 1       , __a :							float = 0.0       , __a :							Optional[torch.Generator] = None       , __a :							Optional[torch.FloatTensor] = None       , __a :							Optional[str] = "pil"       , __a :							bool = True       , __a :							Optional[Callable[[int, int, torch.FloatTensor], None]] = None       , __a :							int = 1       , **__a :							List[Any]       , )		->					Union[str, Any]:
        return self.pipea(
            prompt=__a       , height=__a       , width=__a       , num_inference_steps=__a       , guidance_scale=__a       , negative_prompt=__a       , num_images_per_prompt=__a       , eta=__a       , generator=__a       , latents=__a       , output_type=__a       , return_dict=__a       , callback=__a       , callback_steps=__a       , **__a       , )


  @torch.no_grad()
  def  __SCREAMING_SNAKE_CASE					(		self :							str       , __a :							Union[str, List[str]]       , __a :							int = 512       , __a :							int = 512       , __a :							int = 50       , __a :							float = 7.5       , __a :							Optional[Union[str, List[str]]] = None       , __a :							Optional[int] = 1       , __a :							float = 0.0       , __a :							Optional[torch.Generator] = None       , __a :							Optional[torch.FloatTensor] = None       , __a :							Optional[str] = "pil"       , __a :							bool = True       , __a :							Optional[Callable[[int, int, torch.FloatTensor], None]] = None       , __a :							int = 1       , **__a :							int       , )		->					List[Any]:
        _UpperCamelCase   :						Tuple    =							"cuda" if torch.cuda.is_available() else "cpu"
        self.to(__a						)

        # Checks if the height and width are divisible by 8 or not
        if height % 8 != 0 or width % 8 != 0:
              raise ValueError(F'''`height` and `width` must be divisible by 8 but are {height} and {width}.'''						)

        # Get first result from Stable Diffusion Checkpoint v1.1
        _UpperCamelCase   :						List[str]    =							self.textaimg_sda_a(
            prompt=__a       , height=__a       , width=__a       , num_inference_steps=__a       , guidance_scale=__a       , negative_prompt=__a       , num_images_per_prompt=__a       , eta=__a       , generator=__a       , latents=__a       , output_type=__a       , return_dict=__a       , callback=__a       , callback_steps=__a       , **__a       , )

        # Get first result from Stable Diffusion Checkpoint v1.2
        _UpperCamelCase   :						Optional[Any]    =							self.textaimg_sda_a(
            prompt=__a       , height=__a       , width=__a       , num_inference_steps=__a       , guidance_scale=__a       , negative_prompt=__a       , num_images_per_prompt=__a       , eta=__a       , generator=__a       , latents=__a       , output_type=__a       , return_dict=__a       , callback=__a       , callback_steps=__a       , **__a       , )

        # Get first result from Stable Diffusion Checkpoint v1.3
        _UpperCamelCase   :						str    =							self.textaimg_sda_a(
            prompt=__a       , height=__a       , width=__a       , num_inference_steps=__a       , guidance_scale=__a       , negative_prompt=__a       , num_images_per_prompt=__a       , eta=__a       , generator=__a       , latents=__a       , output_type=__a       , return_dict=__a       , callback=__a       , callback_steps=__a       , **__a       , )

        # Get first result from Stable Diffusion Checkpoint v1.4
        _UpperCamelCase   :						str    =							self.textaimg_sda_a(
            prompt=__a       , height=__a       , width=__a       , num_inference_steps=__a       , guidance_scale=__a       , negative_prompt=__a       , num_images_per_prompt=__a       , eta=__a       , generator=__a       , latents=__a       , output_type=__a       , return_dict=__a       , callback=__a       , callback_steps=__a       , **__a       , )

        # Get all result images into a single list and pass it via StableDiffusionPipelineOutput for final result
        return StableDiffusionPipelineOutput([resa[0], resa[0], resa[0], resa[0]]						)
