





from typing import Any


def       UpperCamelCase__    (		lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__       ,):
				_validation(
				    lowercase__       ,lowercase__       ,lowercase__       ,lowercase__       ,lowercase__       ,)
				# Creates data structures and fill initial step
				lowercase							=     {}
				lowercase							=     {}
				for state in states_space:
								lowercase							=     observations_space[0]
								lowercase							=     (
								    initial_probabilities[state] * emission_probabilities[state][observation]
								)
								lowercase							=     None

				# Fills the data structure with the probabilities of
				# different transitions and pointers to previous states
				for o in range(1       ,len(lowercase__ ) ):
								lowercase							=     observations_space[o]
								lowercase							=     observations_space[o - 1]
								for state in states_space:
												# Calculates the argmax for probability function
												lowercase							=     """"""
												lowercase							=     -1
												for k_state in states_space:
																lowercase							=     (
																    probabilities[(k_state, prior_observation)]
																    * transition_probabilities[k_state][state]
																    * emission_probabilities[state][observation]
																)
																if probability > max_probability:
																				lowercase							=     probability
																				lowercase							=     k_state

            # Update probabilities and pointers dicts
												lowercase							=     (
												    probabilities[(arg_max, prior_observation)]
												    * transition_probabilities[arg_max][state]
												    * emission_probabilities[state][observation]
												)

												lowercase							=     arg_max

    # The final observation
				lowercase							=     observations_space[len(lowercase__ ) - 1]

				# argmax for given final observation
				lowercase							=     """"""
				lowercase							=     -1
				for k_state in states_space:
								lowercase							=     probabilities[(k_state, final_observation)]
								if probability > max_probability:
												lowercase							=     probability
												lowercase							=     k_state
				lowercase							=     arg_max

				# Process pointers backwards
				lowercase							=     last_state
				lowercase							=     []
				for o in range(len(lowercase__ ) - 1       ,-1       ,-1 ):
								result.append(lowercase__ )
								lowercase							=     pointers[previous, observations_space[o]]
				result.reverse()

				return result


def       UpperCamelCase__    (		lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__       ,):
				_validate_not_empty(
				    lowercase__       ,lowercase__       ,lowercase__       ,lowercase__       ,lowercase__       ,)
				_validate_lists(lowercase__       ,lowercase__ )
				_validate_dicts(
				    lowercase__       ,lowercase__       ,lowercase__ )


def       UpperCamelCase__    (		lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__       ,):





				if not all(
				    [
				        observations_space,
				        states_space,
				        initial_probabilities,
				        transition_probabilities,
				        emission_probabilities,
				    ] ):
								raise ValueError("""There\'s an empty parameter""" )


def       UpperCamelCase__    (		lowerCAmelCase__       ,lowerCAmelCase__ ):
				_validate_list(lowercase__       ,"""observations_space""" )
				_validate_list(lowercase__       ,"""states_space""" )


def       UpperCamelCase__    (		lowerCAmelCase__       ,lowerCAmelCase__ ):





				if not isinstance(_object       ,lowercase__ ):
								lowercase							=     f"""{var_name} must be a list"""
								raise ValueError(lowercase__ )
				else:
								for x in _object:
												if not isinstance(lowercase__       ,lowercase__ ):
																lowercase							=     f"""{var_name} must be a list of strings"""
																raise ValueError(lowercase__ )


def       UpperCamelCase__    (		lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__       ,):
				_validate_dict(lowercase__       ,"""initial_probabilities"""       ,lowercase__ )
				_validate_nested_dict(lowercase__       ,"""transition_probabilities""" )
				_validate_nested_dict(lowercase__       ,"""emission_probabilities""" )


def       UpperCamelCase__    (		lowerCAmelCase__       ,lowerCAmelCase__ ):
				_validate_dict(_object       ,lowercase__       ,lowercase__ )
				for x in _object.values():
								_validate_dict(lowercase__       ,lowercase__       ,lowercase__       ,lowercase__ )


def       UpperCamelCase__    (		lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__ = False ):





				if not isinstance(_object       ,lowercase__ ):
								lowercase							=     f"""{var_name} must be a dict"""
								raise ValueError(lowercase__ )
				if not all(isinstance(lowercase__       ,lowercase__ ) for x in _object ):
								lowercase							=     f"""{var_name} all keys must be strings"""
								raise ValueError(lowercase__ )
				if not all(isinstance(lowercase__       ,lowercase__ ) for x in _object.values() ):
								lowercase							=     """nested dictionary """ if nested else """"""
								lowercase							=     f"""{var_name} {nested_text}all values must be {value_type.__name__}"""
								raise ValueError(lowercase__ )


if __name__ == "__main__":
					from doctest import testmod

					testmod()





'''simple docstring'''

def 					__UpperCamelCase				(						lowercase__    :	int			):






     '''simple docstring'''





     if n == 1 or not isinstance(lowercase__,       lowercase__			):
          return 0
     elif n == 2:
          return 1
     else:
          __lowercase      		=[0, 1]
          for i in range(2,       n + 1			):
               sequence.append(sequence[i - 1] + sequence[i - 2]			)

          return sequence[n]

def 					__UpperCamelCase				(						lowercase__    :	int			):






     '''simple docstring'''





     __lowercase      		=0
     __lowercase      		=2

     while digits < n:
          index += 1
          __lowercase      		=len(str(fibonacci(lowercase__			)			)			)

     return index

def 					__UpperCamelCase				(						lowercase__    :	int = 10_00			):






     '''simple docstring'''





     return fibonacci_digits_index(lowercase__			)


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


