




"""simple docstring"""




import os
import warnings
from typing import List, Optional

from ...tokenization_utils_base import BatchEncoding
from ...utils import logging
from .configuration_rag import RagConfig


lowerCAmelCase							:			Any     							=							logging.get_logger(__name__)






class     __magic_name__							:






				'''simple docstring'''





				def __init__(       self		, _a		, _a ):





							"""simple docstring"""
							lowerCamelCase			      =					question_encoder
							lowerCamelCase			      =					generator
							lowerCamelCase			      =					self.question_encoder





				def    _lowerCAmelCase				(       self		, _a ):





							"""simple docstring"""
							if os.path.isfile(_a ):
										raise ValueError(f'Provided path ({save_directory}) should be a directory, not a file' )
							os.makedirs(_a		, exist_ok=_a )
							lowerCamelCase			      =					os.path.join(_a		, """question_encoder_tokenizer""" )
							lowerCamelCase			      =					os.path.join(_a		, """generator_tokenizer""" )
							self.question_encoder.save_pretrained(_a )
							self.generator.save_pretrained(_a )





				@classmethod
				def    _lowerCAmelCase				(       cls		, _a		, **_a ):





							"""simple docstring"""
							# dynamically import AutoTokenizer
							from ..auto.tokenization_auto import AutoTokenizer

							lowerCamelCase			      =					kwargs.pop("""config"""		, _a )

							if config is None:
										lowerCamelCase			      =					RagConfig.from_pretrained(_a )

							lowerCamelCase			      =					AutoTokenizer.from_pretrained(
							    _a		, config=config.question_encoder		, subfolder="""question_encoder_tokenizer""" )
							lowerCamelCase			      =					AutoTokenizer.from_pretrained(
							    _a		, config=config.generator		, subfolder="""generator_tokenizer""" )
							return cls(question_encoder=_a		, generator=_a )





				def __call__(       self		, *_a		, **_a ):





							"""simple docstring"""
							return self.current_tokenizer(*_a		, **_a )





				def    _lowerCAmelCase				(       self		, *_a		, **_a ):





							"""simple docstring"""
							return self.generator.batch_decode(*_a		, **_a )





				def    _lowerCAmelCase				(       self		, *_a		, **_a ):





							"""simple docstring"""
							return self.generator.decode(*_a		, **_a )





				def    _lowerCAmelCase				(       self ):





							"""simple docstring"""
							lowerCamelCase			      =					self.question_encoder





				def    _lowerCAmelCase				(       self ):





							"""simple docstring"""
							lowerCamelCase			      =					self.generator





				def    _lowerCAmelCase				(       self		, _a		, _a = None		, _a = None		, _a = None		, _a = "longest"		, _a = None		, _a = True		, **_a		, ):





							"""simple docstring"""
							warnings.warn(
							    """`prepare_seq2seq_batch` is deprecated and will be removed in version 5 of 🤗 Transformers. Use the """
							    """regular `__call__` method to prepare your inputs and the tokenizer under the `with_target_tokenizer` """
							    """context manager to prepare your targets. See the documentation of your specific tokenizer for more """
							    """details"""		, _a		, )
							if max_length is None:
										lowerCamelCase			      =					self.current_tokenizer.model_max_length
							lowerCamelCase			      =					self(
							    _a		, add_special_tokens=_a		, return_tensors=_a		, max_length=_a		, padding=_a		, truncation=_a		, **_a		, )
							if tgt_texts is None:
										return model_inputs
							# Process tgt_texts
							if max_target_length is None:
										lowerCamelCase			      =					self.current_tokenizer.model_max_length
							lowerCamelCase			      =					self(
							    text_target=_a		, add_special_tokens=_a		, return_tensors=_a		, padding=_a		, max_length=_a		, truncation=_a		, **_a		, )
							lowerCamelCase			      =					labels['''input_ids''']
							return model_inputs











"""simple docstring"""



def 						lowercase    (				__snake_case				: int = 1_0_0_0	):
		lowercase_       ,					lowercase_ : str							       =   1, 1
		lowercase_ : List[str]							       =   2
		while True:
				lowercase_ : Tuple							       =   0
				lowercase_ : List[Any]							       =   fa + fa
				lowercase_       ,					lowercase_ : Optional[int]							       =   fa, f
				index += 1
				for _ in str(__snake_case	):
						i += 1
				if i == n:
						break
		return index


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



