






from typing import Callable, Optional

from .. import Features
from ..packaged_modules.generator.generator import Generator
from .abc import AbstractDatasetInputStream




class       snake_case__ (				lowerCamelCase__):

       '''simple docstring'''



       def __init__(				self      ,    a__      ,    a__ = None      ,    a__ = None      ,    a__ = False      ,    a__ = False      ,    a__ = None      ,    a__ = None      ,    **a__      ,    )			->   Optional[Any]:






            '''simple docstring'''





            super().__init__(
                features=snake_case__      ,    cache_dir=snake_case__      ,    keep_in_memory=snake_case__      ,    streaming=snake_case__      ,    num_proc=snake_case__      ,    **snake_case__      ,    )
            __snake_case      :Tuple 							=    Generator(
                cache_dir=snake_case__      ,    features=snake_case__      ,    generator=snake_case__      ,    gen_kwargs=snake_case__      ,    **snake_case__      ,    )



       def        __lowercase    (				self     )			->   Optional[int]:






            '''simple docstring'''





            if self.streaming:
                 __snake_case      :str 							=    self.builder.as_streaming_dataset(split="""train"""     )
            # Build regular (map-style) dataset
            else:
                 __snake_case      :Dict 							=    None
                 __snake_case      :Any 							=    None
                 __snake_case      :Optional[int] 							=    None
                 __snake_case      :int 							=    None

                 self.builder.download_and_prepare(
                     download_config=snake_case__      ,    download_mode=snake_case__      ,    verification_mode=snake_case__      ,    base_path=snake_case__      ,    num_proc=self.num_proc      ,    )
                 __snake_case      :Any 							=    self.builder.as_dataset(
                     split="""train"""      ,    verification_mode=snake_case__      ,    in_memory=self.keep_in_memory     )
            return dataset









def  __magic_name__  (				lowercase = 1000				)				-> int:

							"""simple docstring"""



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


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