



import argparse

from transformers import (
    TapasConfig,
    TapasForMaskedLM,
    TapasForQuestionAnswering,
    TapasForSequenceClassification,
    TapasModel,
    TapasTokenizer,
    load_tf_weights_in_tapas,
)
from transformers.utils import logging


logging.set_verbosity_info()







def  lowerCAmelCase_	(lowerCAmelCase__:		Any		,						lowerCAmelCase__:		Optional[int]		,						lowerCAmelCase__:		Dict		,						lowerCAmelCase__:		Tuple		,						lowerCAmelCase__:		str  ):





			"""simple docstring"""


			UpperCAmelCase_:		str							      =     TapasConfig.from_json_file(lowerCAmelCase__  )
			# set absolute/relative position embeddings parameter
			UpperCAmelCase_:		Union[str, Any]							      =     reset_position_index_per_cell

			# set remaining parameters of TapasConfig as well as the model based on the task
			if task == "SQA":
						UpperCAmelCase_:		List[str]							      =     TapasForQuestionAnswering(config=lowerCAmelCase__  )
			elif task == "WTQ":
						# run_task_main.py hparams
						UpperCAmelCase_:		Optional[Any]							      =     4
						UpperCAmelCase_:		Any							      =     True
						# hparam_utils.py hparams
						UpperCAmelCase_:		str							      =     0.664694
						UpperCAmelCase_:		List[Any]							      =     0.207951
						UpperCAmelCase_:		Optional[Any]							      =     0.121194
						UpperCAmelCase_:		Tuple							      =     True
						UpperCAmelCase_:		Union[str, Any]							      =     True
						UpperCAmelCase_:		List[str]							      =     False
						UpperCAmelCase_:		str							      =     0.0352513

						UpperCAmelCase_:		Dict							      =     TapasForQuestionAnswering(config=lowerCAmelCase__  )
			elif task == "WIKISQL_SUPERVISED":
						# run_task_main.py hparams
						UpperCAmelCase_:		Dict							      =     4
						UpperCAmelCase_:		Tuple							      =     False
						# hparam_utils.py hparams
						UpperCAmelCase_:		Dict							      =     36.4519
						UpperCAmelCase_:		Union[str, Any]							      =     0.903421
						UpperCAmelCase_:		Optional[Any]							      =     222.088
						UpperCAmelCase_:		Dict							      =     True
						UpperCAmelCase_:		Optional[int]							      =     True
						UpperCAmelCase_:		Optional[int]							      =     True
						UpperCAmelCase_:		Tuple							      =     0.763141

						UpperCAmelCase_:		int							      =     TapasForQuestionAnswering(config=lowerCAmelCase__  )
			elif task == "TABFACT":
						UpperCAmelCase_:		Any							      =     TapasForSequenceClassification(config=lowerCAmelCase__  )
			elif task == "MLM":
						UpperCAmelCase_:		Tuple							      =     TapasForMaskedLM(config=lowerCAmelCase__  )
			elif task == "INTERMEDIATE_PRETRAINING":
						UpperCAmelCase_:		int							      =     TapasModel(config=lowerCAmelCase__  )
			else:
						raise ValueError(F'Task {task} not supported.'  )

			print(F'Building PyTorch model from configuration: {config}'  )
			# Load weights from tf checkpoint
			load_tf_weights_in_tapas(lowerCAmelCase__		,						lowerCAmelCase__		,						lowerCAmelCase__  )

			# Save pytorch-model (weights and configuration)
			print(F'Save PyTorch model to {pytorch_dump_path}'  )
			model.save_pretrained(lowerCAmelCase__  )

			# Save tokenizer files
			print(F'Save tokenizer files to {pytorch_dump_path}'  )
			UpperCAmelCase_:		int							      =     TapasTokenizer(vocab_file=tf_checkpoint_path[:-1_0] + """vocab.txt"""		,						model_max_length=5_1_2  )
			tokenizer.save_pretrained(lowerCAmelCase__  )

			print("""Used relative position embeddings:"""		,						model.config.reset_position_index_per_cell  )


if __name__ == "__main__":
	a      :  Optional[Any]			     =			argparse.ArgumentParser()
	# Required parameters
	parser.add_argument(
	    '--task', default='SQA', type=str, help='Model task for which to convert a checkpoint. Defaults to SQA.'
	)
	parser.add_argument(
	    '--reset_position_index_per_cell',
	    default=False,
	    action='store_true',
	    help='Whether to use relative position embeddings or not. Defaults to True.',
	)
	parser.add_argument(
	    '--tf_checkpoint_path', default=None, type=str, required=True, help='Path to the TensorFlow checkpoint path.'
	)
	parser.add_argument(
	    '--tapas_config_file',
	    default=None,
	    type=str,
	    required=True,
	    help=(
	        'The config json file corresponding to the pre-trained TAPAS model. \n'
	        'This specifies the model architecture.'
	    ),
	)
	parser.add_argument(
	    '--pytorch_dump_path', default=None, type=str, required=True, help='Path to the output PyTorch model.'
	)
	a      :  Optional[int]			     =			parser.parse_args()
	convert_tf_checkpoint_to_pytorch(
	    args.task,
	    args.reset_position_index_per_cell,
	    args.tf_checkpoint_path,
	    args.tapas_config_file,
	    args.pytorch_dump_path,
	)











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






