



def      lowerCAmelCase__		(   lowerCamelCase_		:		Optional[Any]	,lowerCamelCase_		:		Union[str, Any]):





				'''simple docstring'''

				lowerCAmelCase__					:    Optional[Any]												=					[1]
				for i in range(2	,lowerCamelCase_):
								factorials.append(factorials[-1] * i)
				assert 0 <= k < factorials[-1] * n, "k out of bounds"

				lowerCAmelCase__					:    Tuple												=					[]
				lowerCAmelCase__					:    List[str]												=					list(range(lowerCamelCase_))

				# Find permutation
				while factorials:
								lowerCAmelCase__					:    List[Any]												=					factorials.pop()
								lowerCAmelCase__						,		lowerCAmelCase__					:    List[str]												=					divmod(lowerCamelCase_	,lowerCamelCase_)
								permutation.append(elements[number])
								elements.remove(elements[number])
				permutation.append(elements[0])

				return permutation


if __name__ == "__main__":
							import doctest

							doctest.testmod()






def      lowerCAmelCase__		(   lowerCamelCase_		:		int = 1000):





				'''simple docstring'''

				lowerCAmelCase__						,		lowerCAmelCase__					:    int												=					1, 1
				lowerCAmelCase__					:    Any												=					2
				while True:
								lowerCAmelCase__					:    Optional[Any]												=					0
								lowerCAmelCase__					:    Any												=					fa + fa
								lowerCAmelCase__						,		lowerCAmelCase__					:    Optional[Any]												=					fa, f
								index += 1
								for _ in str(lowerCamelCase_):
												i += 1
								if i == n:
												break
				return index


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

