





import numpy as np
import torch
from imwatermark import WatermarkEncoder


# Copied from https://github.com/Stability-AI/generative-models/blob/613af104c6b85184091d42d374fef420eddb356d/scripts/demo/streamlit_helpers.py#L66
__lowerCamelCase	:					int			  =					0b1_0_1_1_0_0_1_1_1_1_1_0_1_1_0_0_1_0_0_1_0_0_0_0_0_1_1_1_1_0_1_1_1_0_1_1_0_0_0_1_1_0_0_1_1_1_1_0
# bin(x)[2:] gives bits of x as str, use int to convert them to 0/1
__lowerCamelCase	:					int			  =					[int(bit) for bit in bin(WATERMARK_MESSAGE)[2:]]



class  A__       :





      def __init__(			self       ):
       '''simple docstring'''




       UpperCamelCase     : Dict	     =       WATERMARK_BITS
       UpperCamelCase     : List[Any]	     =       WatermarkEncoder()

       self.encoder.set_watermark("bits"	,							self.watermark       )





      def 	__UpperCamelCase(			self	,							A_       ):
       '''simple docstring'''




       if images.shape[-1] < 256:
        return images

       UpperCamelCase     : int	     =       (255 * (images / 2 + 0.5)).cpu().permute(0	,							2	,							3	,							1       ).float().numpy()

       UpperCamelCase     : int	     =       [self.encoder.encode(_A	,							"dwtDct"       ) for image in images]

       UpperCamelCase     : Optional[Any]	     =       torch.from_numpy(np.array(_A       )       ).permute(0	,							3	,							1	,							2       )

       UpperCamelCase     : List[Any]	     =       torch.clamp(2 * (images / 255 - 0.5)	,							min=-1.0	,							max=1.0       )
       return images







def 		A_    (					_lowerCAmelCase					)						->			int:
 if n == 1 or not isinstance(_lowerCAmelCase							,       _lowerCAmelCase					):
  return 0
 elif n == 2:
  return 1
 else:
  UpperCamelCase     : Optional[Any]	     =       [0, 1]
  for i in range(2							,       n + 1					):
   sequence.append(sequence[i - 1] + sequence[i - 2]					)

  return sequence[n]



def 		A_    (					_lowerCAmelCase					)						->			int:
 UpperCamelCase     : Any	     =       0
 UpperCamelCase     : List[Any]	     =       2

 while digits < n:
  index += 1
  UpperCamelCase     : Union[str, Any]	     =       len(str(fibonacci(_lowerCAmelCase					)					)					)

 return index



def 		A_    (					_lowerCAmelCase = 1000					)						->			int:
 return fibonacci_digits_index(_lowerCAmelCase					)


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