




"""simple docstring"""




from __future__ import annotations

from collections.abc import Iterator






class     __magic_name__							:






				'''simple docstring'''





				def __init__(       self		, _a ):





							"""simple docstring"""
							lowerCamelCase			      =					value
							lowerCamelCase			      =					None
							lowerCamelCase			      =					None






class     __magic_name__							:






				'''simple docstring'''





				def __init__(       self		, _a ):





							"""simple docstring"""
							lowerCamelCase			      =					tree





				def    _lowerCAmelCase				(       self		, _a ):





							"""simple docstring"""
							if node is None:
										return 0
							return node.value + (
							    self.depth_first_search(node.left ) + self.depth_first_search(node.right )
							)





				def __iter__(       self ):





							"""simple docstring"""
							yield self.depth_first_search(self.tree )


if __name__ == "__main__":
					import doctest

					doctest.testmod()











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



