






from collections import UserDict
from typing import List, Union

from ..utils import (
    add_end_docstrings,
    is_tf_available,
    is_torch_available,
    is_vision_available,
    logging,
    requires_backends,
)
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_ZERO_SHOT_IMAGE_CLASSIFICATION_MAPPING

if is_tf_available():
							from ..models.auto.modeling_tf_auto import TF_MODEL_FOR_ZERO_SHOT_IMAGE_CLASSIFICATION_MAPPING
							from ..tf_utils import stable_softmax

__lowerCAmelCase :Tuple     =    logging.get_logger(__name__)






@add_end_docstrings(lowercase__    )
class        _a(    lowercase__    ):







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


							'''simple docstring'''

							super().__init__(**__lowerCamelCase				)

							requires_backends(self ,						"vision"				)
							self.check_model_type(
							    TF_MODEL_FOR_ZERO_SHOT_IMAGE_CLASSIFICATION_MAPPING
							    if self.framework == "tf"
							    else MODEL_FOR_ZERO_SHOT_IMAGE_CLASSIFICATION_MAPPING				)







		def __call__(    self ,						__snake_case ,						**__snake_case				)      ->      List[Any]:


							'''simple docstring'''

							return super().__call__(__lowerCamelCase ,						**__lowerCamelCase				)







		def        lowercase       (    self ,						**__snake_case				)      ->      str:


							'''simple docstring'''

							_snake_case       :					Union[str, Any]				       =   {}
							if "candidate_labels" in kwargs:
												_snake_case       :					Optional[Any]				       =   kwargs["candidate_labels"]
							if "hypothesis_template" in kwargs:
												_snake_case       :					str				       =   kwargs["hypothesis_template"]

							return preprocess_params, {}, {}







		def        lowercase       (    self ,						__snake_case ,						__snake_case=None ,						__snake_case="This is a photo of {}."				)      ->      Dict:


							'''simple docstring'''

							_snake_case       :					int				       =   load_image(__lowerCamelCase				)
							_snake_case       :					List[str]				       =   self.image_processor(images=[image] ,						return_tensors=self.framework				)
							_snake_case       :					List[Any]				       =   candidate_labels
							_snake_case       :					Any				       =   [hypothesis_template.format(__lowerCamelCase				) for x in candidate_labels]
							_snake_case       :					int				       =   self.tokenizer(__lowerCamelCase ,						return_tensors=self.framework ,						padding=__lowerCamelCase				)
							_snake_case       :					str				       =   [text_inputs]
							return inputs







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


							'''simple docstring'''

							_snake_case       :					Optional[Any]				       =   model_inputs.pop("candidate_labels"				)
							_snake_case       :					List[str]				       =   model_inputs.pop("text_inputs"				)
							if isinstance(text_inputs[0] ,						__lowerCamelCase				):
												_snake_case       :					Optional[Any]				       =   text_inputs[0]
							else:
												# Batching case.
												_snake_case       :					Union[str, Any]				       =   text_inputs[0][0]

							_snake_case       :					Optional[int]				       =   self.model(**__lowerCamelCase ,						**__lowerCamelCase				)

							_snake_case       :					List[Any]				       =   {
							    "candidate_labels": candidate_labels,
							    "logits": outputs.logits_per_image,
							}
							return model_outputs







		def        lowercase       (    self ,						__snake_case				)      ->      Optional[int]:


							'''simple docstring'''

							_snake_case       :					Union[str, Any]				       =   model_outputs.pop("candidate_labels"				)
							_snake_case       :					Optional[int]				       =   model_outputs["logits"][0]
							if self.framework == "pt":
												_snake_case       :					Tuple				       =   logits.softmax(dim=-1				).squeeze(-1				)
												_snake_case       :					List[str]				       =   probs.tolist()
												if not isinstance(__lowerCamelCase ,						__lowerCamelCase				):
																	_snake_case       :					str				       =   [scores]
							elif self.framework == "tf":
												_snake_case       :					Tuple				       =   stable_softmax(__lowerCamelCase ,						axis=-1				)
												_snake_case       :					Dict				       =   probs.numpy().tolist()
							else:
												raise ValueError(f"""Unsupported framework: {self.framework}"""				)

							_snake_case       :					str				       =   [
							    {"score": score, "label": candidate_label}
							    for score, candidate_label in sorted(zip(__lowerCamelCase ,						__lowerCamelCase				) ,						key=lambda __snake_case				: -x[0]				)
							]
							return result






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())))