
import argparse

import torch
from torch import nn

from transformers import PLBartConfig, PLBartForConditionalGeneration, PLBartForSequenceClassification


def       UpperCAmelCase__							(    __magic_name__  :       int					):


					'''simple docstring'''

					lowerCAmelCase						:   int							=       [
					    '''encoder.version''',
					    '''decoder.version''',
					    '''model.encoder.version''',
					    '''model.decoder.version''',
					    '''_float_tensor''',
					    '''decoder.output_projection.weight''',
					]
					for k in ignore_keys:
										state_dict.pop(lowercase_							,					lowercase_					)


def       UpperCAmelCase__							(    __magic_name__  :       int					):


					'''simple docstring'''

					lowerCAmelCase		,							lowerCAmelCase						:   Tuple							=       emb.weight.shape
					lowerCAmelCase						:   int							=       nn.Linear(lowercase_							,					lowercase_							,					bias=lowercase_					)
					lowerCAmelCase						:   Dict							=       emb.weight.data
					return lin_layer


def       UpperCAmelCase__							(    __magic_name__  :       Union[str, Any]							,					__magic_name__  :       Tuple="uclanlp/plbart-base"							,					__magic_name__  :       Dict=False							,					__magic_name__  :       List[Any]=False					):


					'''simple docstring'''

					lowerCAmelCase						:   List[Any]							=       torch.load(lowercase_							,					map_location='''cpu'''					)['''model''']
					remove_ignore_keys_(lowercase_					)
					lowerCAmelCase						:   Dict							=       state_dict['''encoder.embed_tokens.weight'''].shape[0]

					lowerCAmelCase						:   List[Any]							=       PLBartConfig.from_pretrained(lowercase_							,					vocab_size=lowercase_					)

					lowerCAmelCase						:   Union[str, Any]							=       state_dict['''decoder.embed_tokens.weight''']
					if not classification:
										lowerCAmelCase						:   List[str]							=       PLBartForConditionalGeneration(lowercase_					)
										model.model.load_state_dict(lowercase_					)
										if finetuned:
															lowerCAmelCase						:   int							=       make_linear_from_emb(model.model.shared					)

					else:
										lowerCAmelCase						:   Tuple							=       {}
										for key, value in state_dict.copy().items():
															if key.startswith('''classification_heads.sentence_classification_head'''					):
																				lowerCAmelCase						:   Optional[int]							=       value
																				state_dict.pop(lowercase_					)
										lowerCAmelCase						:   Optional[Any]							=       PLBartForSequenceClassification(lowercase_					)
										model.model.load_state_dict(lowercase_					)
										model.classification_head.load_state_dict(lowercase_					)

					return model


if __name__ == "__main__":
		__SCREAMING_SNAKE_CASE     :				Optional[Any]             =       argparse.ArgumentParser()
		# Required parameters
		parser.add_argument('fairseq_path', type=str, help='model.pt on local filesystem.')
		parser.add_argument('pytorch_dump_folder_path', default=None, type=str, help='Path to the output PyTorch model.')
		parser.add_argument(
		    '--hf_config',
		    default='uclanlp/plbart-base',
		    type=str,
		    help='Which huggingface architecture to use: plbart-base',
		)
		parser.add_argument('--finetuned', action='store_true', help='whether the model is a fine-tuned checkpoint')
		parser.add_argument(
		    '--classification', action='store_true', help='whether the model is a classification checkpoint'
		)
		__SCREAMING_SNAKE_CASE     :				Optional[int]             =       parser.parse_args()
		__SCREAMING_SNAKE_CASE     :				List[str]             =       convert_fairseq_plbart_checkpoint_from_disk(
		    args.fairseq_path,
		    hf_config_path=args.hf_config,
		    finetuned=args.finetuned,
		    classification=args.classification,
		)
		model.save_pretrained(args.pytorch_dump_folder_path)


from math import floor, sqrt
def       UpperCAmelCase__							(    __magic_name__  :       int					):


					'''simple docstring'''

					lowerCAmelCase						:   int							=       0.0
					lowerCAmelCase						:   int							=       1.0
					lowerCAmelCase						:   Any							=       int(sqrt(__magic_name__					)					)
					lowerCAmelCase						:   Optional[int]							=       root
					lowerCAmelCase						:   Dict							=       0
					while integer_part != 2 * root:
										lowerCAmelCase						:   str							=       denominator * integer_part - numerator
										lowerCAmelCase						:   Dict							=       (n - numerator**2) / denominator
										lowerCAmelCase						:   str							=       int((root + numerator) / denominator					)
										period += 1
					return period
def       UpperCAmelCase__							(    __magic_name__  :       int = 1_00_00					):


					'''simple docstring'''

					lowerCAmelCase						:   List[str]							=       0
					for i in range(2							,					n + 1					):
										lowerCAmelCase						:   Any							=       sqrt(__magic_name__					)
										if sr - floor(__magic_name__					) != 0 and continuous_fraction_period(__magic_name__					) % 2 == 1:
															count_odd_periods += 1
					return count_odd_periods


if __name__ == "__main__":
		print(f"""{solution(int(input().strip()))}""")
