



import json
import os
import tempfile

import transformers

import datasets
from utils import generate_example_dataset, get_duration


a      :  List[Any]			     =			500_000

a     ,a      :  Tuple			     =			os.path.split(__file__)
a      :  Tuple			     =			os.path.join(RESULTS_BASEPATH, 'results', RESULTS_FILENAME.replace('.py', '.json'))







@get_duration
def  lowerCAmelCase_	(lowerCAmelCase__:		datasets.Dataset		,						**lowerCAmelCase__:		List[str]  ):





			"""simple docstring"""


			UpperCAmelCase_:		Tuple							      =     dataset.map(**lowerCAmelCase__  )







@get_duration
def  lowerCAmelCase_	(lowerCAmelCase__:		datasets.Dataset		,						**lowerCAmelCase__:		str  ):





			"""simple docstring"""


			UpperCAmelCase_:		List[Any]							      =     dataset.filter(**lowerCAmelCase__  )







def  lowerCAmelCase_	():





			"""simple docstring"""


			UpperCAmelCase_:		List[Any]							      =     {"""num examples""": SPEED_TEST_N_EXAMPLES}
			with tempfile.TemporaryDirectory() as tmp_dir:
						UpperCAmelCase_:		Dict							      =     datasets.Features({"""text""": datasets.Value("""string"""  ), """numbers""": datasets.Value("""float32"""  )}  )
						UpperCAmelCase_:		List[Any]							      =     generate_example_dataset(
						    os.path.join(lowerCAmelCase__		,						"""dataset.arrow"""  )		,						lowerCAmelCase__		,						num_examples=lowerCAmelCase__  )

						UpperCAmelCase_:		List[str]							      =     transformers.AutoTokenizer.from_pretrained("""bert-base-cased"""		,						use_fast=lowerCAmelCase__  )

						def tokenize(lowerCAmelCase__:		Dict  ):
									return tokenizer(examples["""text"""]  )

						UpperCAmelCase_:		Optional[int]							      =     map(lowerCAmelCase__  )

						UpperCAmelCase_:		Optional[int]							      =     map(lowerCAmelCase__		,						batched=lowerCAmelCase__  )

						UpperCAmelCase_:		str							      =     map(lowerCAmelCase__		,						function=lambda lowerCAmelCase__  : None		,						batched=lowerCAmelCase__  )

						with dataset.formatted_as(type="""numpy"""  ):
									UpperCAmelCase_:		List[str]							      =     map(lowerCAmelCase__		,						function=lambda lowerCAmelCase__  : None		,						batched=lowerCAmelCase__  )

						with dataset.formatted_as(type="""pandas"""  ):
									UpperCAmelCase_:		Any							      =     map(lowerCAmelCase__		,						function=lambda lowerCAmelCase__  : None		,						batched=lowerCAmelCase__  )

						with dataset.formatted_as(type="""torch"""		,						columns="""numbers"""  ):
									UpperCAmelCase_:		Tuple							      =     map(lowerCAmelCase__		,						function=lambda lowerCAmelCase__  : None		,						batched=lowerCAmelCase__  )

						with dataset.formatted_as(type="""tensorflow"""		,						columns="""numbers"""  ):
									UpperCAmelCase_:		List[Any]							      =     map(lowerCAmelCase__		,						function=lambda lowerCAmelCase__  : None		,						batched=lowerCAmelCase__  )

						UpperCAmelCase_:		Dict							      =     map(lowerCAmelCase__		,						function=lowerCAmelCase__		,						batched=lowerCAmelCase__  )

						UpperCAmelCase_:		int							      =     filter(lowerCAmelCase__  )

						# Activate later when tokenizer support batched inputs
						# with dataset.formatted_as(type='numpy'):
						#     times[func.__name__ + " fast-tokenizer batched numpy"] = func(dataset, function=tokenize, batched=True)

			with open(lowerCAmelCase__		,						"""wb"""  ) as f:
						f.write(json.dumps(lowerCAmelCase__  ).encode("""utf-8"""  )  )


if __name__ == "__main__":  # useful to run the profiler
	benchmark_map_filter()











def  lowerCAmelCase_	(lowerCAmelCase__:		int  ):





			"""simple docstring"""


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

						return sequence[n]







def  lowerCAmelCase_	(lowerCAmelCase__:		int  ):





			"""simple docstring"""


			UpperCAmelCase_:		str							      =     0
			UpperCAmelCase_:		str							      =     2

			while digits < n:
						index += 1
						UpperCAmelCase_:		Union[str, Any]							      =     len(str(fibonacci(lowerCAmelCase__  )  )  )

			return index







def  lowerCAmelCase_	(lowerCAmelCase__:		int = 1_0_0_0  ):





			"""simple docstring"""


			return fibonacci_digits_index(lowerCAmelCase__  )


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






