"""simple docstring"""






import unittest

import numpy as np
import torch

from diffusers import KarrasVePipeline, KarrasVeScheduler, UNetaDModel
from diffusers.utils.testing_utils import enable_full_determinism, require_torch, slow, torch_device


enable_full_determinism()


class     UpperCAmelCase						(unittest.TestCase  ):



    """simple docstring"""

    @property
    def _snake_case			(   self							):
       torch.manual_seed(0							)
       lowercase__:   Union[str, Any]					=      UNetaDModel(
           block_out_channels=(32, 64)    ,			layers_per_block=2    ,			sample_size=32    ,			in_channels=3    ,			out_channels=3    ,			down_block_types=('''DownBlock2D''', '''AttnDownBlock2D''')    ,			up_block_types=('''AttnUpBlock2D''', '''UpBlock2D''')    ,			)
       return model






    def _snake_case			(   self							):
       lowercase__:   Tuple					=      self.dummy_uncond_unet
       lowercase__:   Dict					=      KarrasVeScheduler()

       lowercase__:   Dict					=      KarrasVePipeline(unet=_UpperCAmelCase    ,			scheduler=_UpperCAmelCase							)
       pipe.to(_UpperCAmelCase							)
       pipe.set_progress_bar_config(disable=_UpperCAmelCase							)

       lowercase__:   int					=      torch.manual_seed(0							)
       lowercase__:   List[Any]					=      pipe(num_inference_steps=2    ,			generator=_UpperCAmelCase    ,			output_type='''numpy'''							).images

       lowercase__:   Union[str, Any]					=      torch.manual_seed(0							)
       lowercase__:   int					=      pipe(num_inference_steps=2    ,			generator=_UpperCAmelCase    ,			output_type='''numpy'''    ,			return_dict=_UpperCAmelCase							)[0]

       lowercase__:   List[str]					=      image[0, -3:, -3:, -1]
       lowercase__:   Optional[Any]					=      image_from_tuple[0, -3:, -3:, -1]

       assert image.shape == (1, 32, 32, 3)
       lowercase__:   str					=      np.array([0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0]							)

       assert np.abs(image_slice.flatten() - expected_slice							).max() < 1e-2
       assert np.abs(image_from_tuple_slice.flatten() - expected_slice							).max() < 1e-2



@slow
@require_torch
class     UpperCAmelCase						(unittest.TestCase  ):



    """simple docstring"""

    def _snake_case			(   self							):
       lowercase__:   Dict					=      '''google/ncsnpp-celebahq-256'''
       lowercase__:   List[Any]					=      UNetaDModel.from_pretrained(_UpperCAmelCase							)
       lowercase__:   Union[str, Any]					=      KarrasVeScheduler()

       lowercase__:   Optional[Any]					=      KarrasVePipeline(unet=_UpperCAmelCase    ,			scheduler=_UpperCAmelCase							)
       pipe.to(_UpperCAmelCase							)
       pipe.set_progress_bar_config(disable=_UpperCAmelCase							)

       lowercase__:   Tuple					=      torch.manual_seed(0							)
       lowercase__:   Dict					=      pipe(num_inference_steps=20    ,			generator=_UpperCAmelCase    ,			output_type='''numpy'''							).images

       lowercase__:   Any					=      image[0, -3:, -3:, -1]
       assert image.shape == (1, 256, 256, 3)
       lowercase__:   Union[str, Any]					=      np.array([0.578, 0.5_811, 0.5_924, 0.5_809, 0.587, 0.5_886, 0.5_861, 0.5_802, 0.586]							)

       assert np.abs(image_slice.flatten() - expected_slice							).max() < 1e-2

"""simple docstring"""






def SCREAMING_SNAKE_CASE__			(   __UpperCAmelCase )  ->  int:
   if n == 1 or not isinstance(__UpperCAmelCase       ,    __UpperCAmelCase ):
      return 0
   elif n == 2:
      return 1
   else:
      lowercase__:   List[Any]					=      [0, 1]
      for i in range(2       ,    n + 1 ):
         sequence.append(sequence[i - 1] + sequence[i - 2] )

      return sequence[n]



def SCREAMING_SNAKE_CASE__			(   __UpperCAmelCase )  ->  int:
   lowercase__:   Union[str, Any]					=      0
   lowercase__:   List[Any]					=      2

   while digits < n:
      index += 1
      lowercase__:   Dict					=      len(str(fibonacci(__UpperCAmelCase ) ) )

   return index



def SCREAMING_SNAKE_CASE__			(   __UpperCAmelCase = 1_0_0_0 )  ->  int:
   return fibonacci_digits_index(__UpperCAmelCase )


if __name__ == "__main__":
       print(solution(int(str(input()).strip())))
