





import warnings
from typing import List, Optional, Union

from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding, PaddingStrategy, PreTokenizedInput, TextInput, TruncationStrategy
from ...utils import TensorType






class        _a(    __A    ):
		lowerCamelCase__     :List[str]   				=		['image_processor', 'tokenizer']
		lowerCamelCase__     :List[Any]   				=		'LayoutLMv2ImageProcessor'
		lowerCamelCase__     :Any   				=		('LayoutXLMTokenizer', 'LayoutXLMTokenizerFast')







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


							'''simple docstring'''

							if "feature_extractor" in kwargs:
												warnings.warn(
												    "The `feature_extractor` argument is deprecated and will be removed in v5, use `image_processor`"
												    " instead." ,						__snake_case ,						)
												_snake_case       :					List[Any]				       =   kwargs.pop("feature_extractor"				)

							_snake_case       :					Optional[Any]				       =   image_processor if image_processor is not None else feature_extractor
							if image_processor is None:
												raise ValueError("You need to specify an `image_processor`."				)
							if tokenizer is None:
												raise ValueError("You need to specify a `tokenizer`."				)

							super().__init__(__snake_case ,						__snake_case				)







		def __call__(    self ,						__snake_case ,						__snake_case = None ,						__snake_case = None ,						__snake_case = None ,						__snake_case = None ,						__snake_case = True ,						__snake_case = False ,						__snake_case = None ,						__snake_case = None ,						__snake_case = 0 ,						__snake_case = None ,						__snake_case = None ,						__snake_case = None ,						__snake_case = False ,						__snake_case = False ,						__snake_case = False ,						__snake_case = False ,						__snake_case = True ,						__snake_case = None ,						**__snake_case ,						)      ->      BatchEncoding:


							'''simple docstring'''

							if self.image_processor.apply_ocr and (boxes is not None):
												raise ValueError(
												    "You cannot provide bounding boxes "
												    "if you initialized the image processor with apply_ocr set to True."				)

							if self.image_processor.apply_ocr and (word_labels is not None):
												raise ValueError(
												    "You cannot provide word labels if you initialized the image processor with apply_ocr set to True."				)

							if return_overflowing_tokens is True and return_offsets_mapping is False:
												raise ValueError("You cannot return overflowing tokens without returning the offsets mapping."				)

							# first, apply the image processor
							_snake_case       :					Dict				       =   self.image_processor(images=__snake_case ,						return_tensors=__snake_case				)

							# second, apply the tokenizer
							if text is not None and self.image_processor.apply_ocr and text_pair is None:
												if isinstance(__snake_case ,						__snake_case				):
																	_snake_case       :					Tuple				       =   [text]  # add batch dimension (as the image processor always adds a batch dimension)
												_snake_case       :					Union[str, Any]				       =   features["words"]

							_snake_case       :					Union[str, Any]				       =   self.tokenizer(
							    text=text if text is not None else features["words"] ,						text_pair=text_pair if text_pair is not None else None ,						boxes=boxes if boxes is not None else features["boxes"] ,						word_labels=__snake_case ,						add_special_tokens=__snake_case ,						padding=__snake_case ,						truncation=__snake_case ,						max_length=__snake_case ,						stride=__snake_case ,						pad_to_multiple_of=__snake_case ,						return_token_type_ids=__snake_case ,						return_attention_mask=__snake_case ,						return_overflowing_tokens=__snake_case ,						return_special_tokens_mask=__snake_case ,						return_offsets_mapping=__snake_case ,						return_length=__snake_case ,						verbose=__snake_case ,						return_tensors=__snake_case ,						**__snake_case ,						)

							# add pixel values
							_snake_case       :					Dict				       =   features.pop("pixel_values"				)
							if return_overflowing_tokens is True:
												_snake_case       :					List[Any]				       =   self.get_overflowing_images(__snake_case ,						encoded_inputs["overflow_to_sample_mapping"]				)
							_snake_case       :					List[str]				       =   images

							return encoded_inputs







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


							'''simple docstring'''

							_snake_case       :					List[str]				       =   []
							for sample_idx in overflow_to_sample_mapping:
												images_with_overflow.append(images[sample_idx]				)

							if len(__snake_case				) != len(__snake_case				):
												raise ValueError(
												    "Expected length of images to be the same as the length of `overflow_to_sample_mapping`, but got"
												    f""" {len(__snake_case				)} and {len(__snake_case				)}"""				)

							return images_with_overflow







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


							'''simple docstring'''

							return self.tokenizer.batch_decode(*__snake_case ,						**__snake_case				)







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


							'''simple docstring'''

							return self.tokenizer.decode(*__snake_case ,						**__snake_case				)







		@property
		def        lowercase       (    self				)      ->      Optional[int]:


							'''simple docstring'''

							return ["input_ids", "bbox", "attention_mask", "image"]







		@property
		def        lowercase       (    self				)      ->      str:


							'''simple docstring'''

							warnings.warn(
							    "`feature_extractor_class` is deprecated and will be removed in v5. Use `image_processor_class` instead." ,						__snake_case ,						)
							return self.image_processor_class







		@property
		def        lowercase       (    self				)      ->      int:


							'''simple docstring'''

							warnings.warn(
							    "`feature_extractor` is deprecated and will be removed in v5. Use `image_processor` instead." ,						__snake_case ,						)
							return self.image_processor






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