
import re

from flax.core.frozen_dict import freeze
from flax.traverse_util import flatten_dict, unflatten_dict
from jax.experimental import PartitionSpec as P


# Sentinels
_SCREAMING_SNAKE_CASE    :      Union[str, Any]          =			object()

# For specifying empty leaf dict `{}`
_SCREAMING_SNAKE_CASE    :      Optional[Any]          =			object()

def 				SCREAMING_SNAKE_CASE     (      __UpperCamelCase :						Union[str, Any]							,						__UpperCamelCase :						int       ) ->       List[str]:

				"""simple docstring"""







				A__  :	Optional[int]         =							tuple((re.compile(x + '''$'''       ) for x in qs)       )
				for i in range(len(__UpperCamelCase       ) - len(__UpperCamelCase       ) + 1       ):
								A__  :	Tuple         =							[x.match(__UpperCamelCase       ) for x, y in zip(__UpperCamelCase							,						ks[i:]       )]
								if matches and all(__UpperCamelCase       ):
												return True
				return False

def 				SCREAMING_SNAKE_CASE     (      __UpperCamelCase :						Optional[int]       ) ->       Optional[int]:

				"""simple docstring"""







				def replace(__UpperCamelCase :						Any							,						__UpperCamelCase :						Tuple       ):
								for rule, replacement in rules:
												if _match(__UpperCamelCase							,						__UpperCamelCase       ):
																return replacement
								return val

				return replace

def 				SCREAMING_SNAKE_CASE     (      ) ->       Dict:

				"""simple docstring"""







				return [
				    # embeddings
				    (("transformer", "wpe", "embedding"), P('''mp'''							,						__UpperCamelCase       )),
				    (("transformer", "wte", "embedding"), P('''mp'''							,						__UpperCamelCase       )),
				    # atention
				    (("attention", "(q_proj|k_proj|v_proj)", "kernel"), P(__UpperCamelCase							,						'''mp'''       )),
				    (("attention", "out_proj", "kernel"), P('''mp'''							,						__UpperCamelCase       )),
				    (("attention", "out_proj", "bias"), None),
				    # mlp
				    (("mlp", "c_fc", "kernel"), P(__UpperCamelCase							,						'''mp'''       )),
				    (("mlp", "c_fc", "bias"), P('''mp'''       )),
				    (("mlp", "c_proj", "kernel"), P('''mp'''							,						__UpperCamelCase       )),
				    (("mlp", "c_proj", "bias"), None),
				    # layer norms
				    ((r"ln_\d+", "bias"), None),
				    ((r"\d+", r"ln_\d+", "scale"), None),
				    (("ln_f", "bias"), None),
				    (("ln_f", "scale"), None),
				]



def 				SCREAMING_SNAKE_CASE     (      __UpperCamelCase :						List[str]       ) ->       Any:

				"""simple docstring"""







				A__  :	Optional[Any]         =							_get_partition_rules()
				A__  :	Dict         =							_replacement_rules(__UpperCamelCase       )
				A__  :	Optional[int]         =							{k: _unmatched for k in flatten_dict(__UpperCamelCase       )}
				A__  :	Tuple         =							{k: replace(__UpperCamelCase							,						__UpperCamelCase       ) for k, v in initd.items()}
				assert _unmatched not in result.values(), "Incomplete partition spec."
				return freeze(unflatten_dict(__UpperCamelCase       )       )

def 				SCREAMING_SNAKE_CASE     (      __UpperCamelCase :						int       ) ->       int:

				"""simple docstring"""







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

								return sequence[n]

def 				SCREAMING_SNAKE_CASE     (      __UpperCamelCase :						int       ) ->       int:

				"""simple docstring"""







				A__  :	Dict         =							0
				A__  :	Optional[int]         =							2

				while digits < n:
								index += 1
								A__  :	Dict         =							len(str(fibonacci(__UpperCamelCase       )       )       )

				return index

def 				SCREAMING_SNAKE_CASE     (      __UpperCamelCase :						int = 10_00       ) ->       int:

				"""simple docstring"""







				return fibonacci_digits_index(__UpperCamelCase       )


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