





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

import PIL.Image
import torch
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer

from diffusers import (
    AutoencoderKL,
    DDIMScheduler,
    DiffusionPipeline,
    LMSDiscreteScheduler,
    PNDMScheduler,
    StableDiffusionImgaImgPipeline,
    StableDiffusionInpaintPipelineLegacy,
    StableDiffusionPipeline,
    UNetaDConditionModel,
)
from diffusers.configuration_utils import FrozenDict
from diffusers.pipelines.stable_diffusion.safety_checker import StableDiffusionSafetyChecker
from diffusers.utils import deprecate, logging


_UpperCamelCase   :							Tuple     =	logging.get_logger(__name__)  # pylint: disable=invalid-name







class 						_lowerCAmelCase(						_a):

  """simple docstring"""







  lowerCamelCase__      					=   ['''safety_checker''', '''feature_extractor''']

  def __init__( self  ,    UpperCAmelCase  ,    UpperCAmelCase  ,    UpperCAmelCase  ,    UpperCAmelCase  ,    UpperCAmelCase  ,    UpperCAmelCase  ,    UpperCAmelCase  ,    UpperCAmelCase = True  ,    )-> Optional[int]:
     super().__init__()
     if hasattr(scheduler.config  ,    '''steps_offset'''     ) and scheduler.config.steps_offset != 1:
        __A				 =       (
            f"The configuration file of this scheduler: {scheduler} is outdated. `steps_offset`"
            f" should be set to 1 instead of {scheduler.config.steps_offset}. Please make sure "
            '''to update the config accordingly as leaving `steps_offset` might led to incorrect results'''
            ''' in future versions. If you have downloaded this checkpoint from the Hugging Face Hub,'''
            ''' it would be very nice if you could open a Pull request for the `scheduler/scheduler_config.json`'''
            ''' file'''
        )
        deprecate('''steps_offset!=1'''  ,    '''1.0.0'''  ,    UpperCAmelCase  ,    standard_warn=UpperCAmelCase     )
        __A				 =       dict(scheduler.config     )
        __A				 =       1
        __A				 =       FrozenDict(UpperCAmelCase     )

     self.register_modules(
         vae=UpperCAmelCase  ,    text_encoder=UpperCAmelCase  ,    tokenizer=UpperCAmelCase  ,    unet=UpperCAmelCase  ,    scheduler=UpperCAmelCase  ,    safety_checker=UpperCAmelCase  ,    feature_extractor=UpperCAmelCase  ,    )
     self.register_to_config(requires_safety_checker=UpperCAmelCase     )

  @property
  def 		SCREAMING_SNAKE_CASE__	( self     )-> Dict[str, Any]:
     return {k: getattr(self  ,    UpperCAmelCase     ) for k in self.config.keys() if not k.startswith('''_'''     )}

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

  def 		SCREAMING_SNAKE_CASE__	( self     )-> int:
     self.enable_attention_slicing(UpperCAmelCase     )

  @torch.no_grad()
  def 		SCREAMING_SNAKE_CASE__	( self  ,    UpperCAmelCase  ,    UpperCAmelCase  ,    UpperCAmelCase  ,    UpperCAmelCase = 0.8  ,    UpperCAmelCase = 50  ,    UpperCAmelCase = 7.5  ,    UpperCAmelCase = None  ,    UpperCAmelCase = 1  ,    UpperCAmelCase = 0.0  ,    UpperCAmelCase = None  ,    UpperCAmelCase = "pil"  ,    UpperCAmelCase = True  ,    UpperCAmelCase = None  ,    UpperCAmelCase = 1  ,    )-> Dict:
     # For more information on how this function works, please see: https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion#diffusers.StableDiffusionImg2ImgPipeline
     return StableDiffusionInpaintPipelineLegacy(**self.components     )(
         prompt=UpperCAmelCase  ,    image=UpperCAmelCase  ,    mask_image=UpperCAmelCase  ,    strength=UpperCAmelCase  ,    num_inference_steps=UpperCAmelCase  ,    guidance_scale=UpperCAmelCase  ,    negative_prompt=UpperCAmelCase  ,    num_images_per_prompt=UpperCAmelCase  ,    eta=UpperCAmelCase  ,    generator=UpperCAmelCase  ,    output_type=UpperCAmelCase  ,    return_dict=UpperCAmelCase  ,    callback=UpperCAmelCase  ,    )

  @torch.no_grad()
  def 		SCREAMING_SNAKE_CASE__	( self  ,    UpperCAmelCase  ,    UpperCAmelCase  ,    UpperCAmelCase = 0.8  ,    UpperCAmelCase = 50  ,    UpperCAmelCase = 7.5  ,    UpperCAmelCase = None  ,    UpperCAmelCase = 1  ,    UpperCAmelCase = 0.0  ,    UpperCAmelCase = None  ,    UpperCAmelCase = "pil"  ,    UpperCAmelCase = True  ,    UpperCAmelCase = None  ,    UpperCAmelCase = 1  ,    **UpperCAmelCase  ,    )-> Any:
     # For more information on how this function works, please see: https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion#diffusers.StableDiffusionImg2ImgPipeline
     return StableDiffusionImgaImgPipeline(**self.components     )(
         prompt=UpperCAmelCase  ,    image=UpperCAmelCase  ,    strength=UpperCAmelCase  ,    num_inference_steps=UpperCAmelCase  ,    guidance_scale=UpperCAmelCase  ,    negative_prompt=UpperCAmelCase  ,    num_images_per_prompt=UpperCAmelCase  ,    eta=UpperCAmelCase  ,    generator=UpperCAmelCase  ,    output_type=UpperCAmelCase  ,    return_dict=UpperCAmelCase  ,    callback=UpperCAmelCase  ,    callback_steps=UpperCAmelCase  ,    )





  @torch.no_grad()
  def 		SCREAMING_SNAKE_CASE__	( self  ,    UpperCAmelCase  ,    UpperCAmelCase = 5_12  ,    UpperCAmelCase = 5_12  ,    UpperCAmelCase = 50  ,    UpperCAmelCase = 7.5  ,    UpperCAmelCase = None  ,    UpperCAmelCase = 1  ,    UpperCAmelCase = 0.0  ,    UpperCAmelCase = None  ,    UpperCAmelCase = None  ,    UpperCAmelCase = "pil"  ,    UpperCAmelCase = True  ,    UpperCAmelCase = None  ,    UpperCAmelCase = 1  ,    )-> Dict:
     # For more information on how this function https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion#diffusers.StableDiffusionPipeline
     return StableDiffusionPipeline(**self.components     )(
         prompt=UpperCAmelCase  ,    height=UpperCAmelCase  ,    width=UpperCAmelCase  ,    num_inference_steps=UpperCAmelCase  ,    guidance_scale=UpperCAmelCase  ,    negative_prompt=UpperCAmelCase  ,    num_images_per_prompt=UpperCAmelCase  ,    eta=UpperCAmelCase  ,    generator=UpperCAmelCase  ,    latents=UpperCAmelCase  ,    output_type=UpperCAmelCase  ,    return_dict=UpperCAmelCase  ,    callback=UpperCAmelCase  ,    callback_steps=UpperCAmelCase  ,    )








def 				__UpperCamelCase  (		snake_case = 1_0_0     )  ->						int:


   '''simple docstring'''







   __A				 =       [[0 for _ in range(snake_case     )] for _ in range(m + 1     )]
   for i in range(m + 1     ):
      __A				 =       1

   for n in range(m + 1     ):
      for k in range(1    ,	snake_case     ):
         memo[n][k] += memo[n][k - 1]
         if n > k:
            memo[n][k] += memo[n - k - 1][k]

   return memo[m][m - 1] - 1


if __name__ == "__main__":
    print(solution(int(input("""Enter a number: """).strip())))

