






from typing import Union

from ..utils import add_end_docstrings, is_torch_available, is_vision_available, logging
from .base import PIPELINE_INIT_ARGS, Pipeline


if is_vision_available():
							from PIL import Image

							from ..image_utils import load_image

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

__lowerCAmelCase :Optional[int]     =    logging.get_logger(__name__)






@add_end_docstrings(__A    )
class        _a(    __A    ):







		def __init__(    self ,						*__snake_case ,						**__snake_case				)      ->      Tuple:


							'''simple docstring'''

							super().__init__(*__snake_case ,						**__snake_case				)
							self.check_model_type(__snake_case				)







		def        lowercase       (    self ,						__snake_case=None ,						__snake_case=None ,						__snake_case=None ,						**__snake_case				)      ->      Dict:


							'''simple docstring'''

							_snake_case       :					Union[str, Any]				       =   {}, {}
							if padding is not None:
												_snake_case       :					Optional[int]				       =   padding
							if truncation is not None:
												_snake_case       :					int				       =   truncation
							if top_k is not None:
												_snake_case       :					str				       =   top_k
							return preprocess_params, {}, postprocess_params







		def __call__(    self ,						__snake_case ,						__snake_case = None ,						**__snake_case				)      ->      Any:


							'''simple docstring'''

							if isinstance(__snake_case ,						(Image.Image, str)				) and isinstance(__snake_case ,						__snake_case				):
												_snake_case       :					Tuple				       =   {"image": image, "question": question}
							else:
												_snake_case       :					str				       =   image
							_snake_case       :					Tuple				       =   super().__call__(__snake_case ,						**__snake_case				)
							return results







		def        lowercase       (    self ,						__snake_case ,						__snake_case=False ,						__snake_case=False				)      ->      Union[str, Any]:


							'''simple docstring'''

							_snake_case       :					Tuple				       =   load_image(inputs["image"]				)
							_snake_case       :					Optional[Any]				       =   self.tokenizer(
							    inputs["question"] ,						return_tensors=self.framework ,						padding=__snake_case ,						truncation=__snake_case				)
							_snake_case       :					Any				       =   self.image_processor(images=__snake_case ,						return_tensors=self.framework				)
							model_inputs.update(__snake_case				)
							return model_inputs







		def        lowercase       (    self ,						__snake_case				)      ->      Dict:


							'''simple docstring'''

							_snake_case       :					Union[str, Any]				       =   self.model(**__snake_case				)
							return model_outputs







		def        lowercase       (    self ,						__snake_case ,						__snake_case=5				)      ->      Dict:


							'''simple docstring'''

							if top_k > self.model.config.num_labels:
												_snake_case       :					List[Any]				       =   self.model.config.num_labels

							if self.framework == "pt":
												_snake_case       :					List[str]				       =   model_outputs.logits.sigmoid()[0]
												_snake_case       :					int				       =   probs.topk(__snake_case				)
							else:
												raise ValueError(f"""Unsupported framework: {self.framework}"""				)

							_snake_case       :					Tuple				       =   scores.tolist()
							_snake_case       :					List[str]				       =   ids.tolist()
							return [{"score": score, "answer": self.model.config.idalabel[_id]} for score, _id in zip(__snake_case ,						__snake_case				)]






def    A				(							UpperCAmelCase				):
					if n == 1 or not isinstance(UpperCAmelCase  ,  UpperCAmelCase				):
										return 0
					elif n == 2:
										return 1
					else:
										_snake_case       :					List[Any]				       =   [0, 1]
										for i in range(2  ,  n + 1				):
															sequence.append(sequence[i - 1] + sequence[i - 2]				)

										return sequence[n]







def    A				(							UpperCAmelCase				):
					_snake_case       :					Tuple				       =   0
					_snake_case       :					Optional[Any]				       =   2

					while digits < n:
										index += 1
										_snake_case       :					str				       =   len(str(fibonacci(UpperCAmelCase				)				)				)

					return index







def    A				(							UpperCAmelCase = 1_000				):
					return fibonacci_digits_index(UpperCAmelCase				)


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