


import unittest

import numpy as np
import PIL
import torch

from diffusers.image_processor import VaeImageProcessor


class        __lowerCamelCase      (				unittest.TestCase ):


				"""simple docstring"""







				@property
				def        lowerCAmelCase__			(				self     :    Optional[Any]					):
								_lowerCAmelCase  						=1
								_lowerCAmelCase  						=3
								_lowerCAmelCase  						=8
								_lowerCAmelCase  						=8

								_lowerCAmelCase  						=torch.rand((batch_size, num_channels, height, width)					)

								return sample






				def        lowerCAmelCase__			(				self     :    Any	,							lowerCamelCase_     :    Any					):
								if isinstance(image[0]	,							PIL.Image.Image					):
												return np.stack([np.array(lowerCamelCase_					) for i in image]	,							axis=0					)
								elif isinstance(lowerCamelCase_	,							torch.Tensor					):
												return image.cpu().numpy().transpose(0	,							2	,							3	,							1					)
								return image






				def        lowerCAmelCase__			(				self     :    Optional[Any]					):
								_lowerCAmelCase  						=VaeImageProcessor(do_resize=lowerCamelCase_	,							do_normalize=lowerCamelCase_					)

								_lowerCAmelCase  						=self.dummy_sample
								_lowerCAmelCase  						=self.to_np(lowerCamelCase_					)

								for output_type in ["pt", "np", "pil"]:
												_lowerCAmelCase  						=image_processor.postprocess(
												    image_processor.preprocess(lowerCamelCase_					)	,							output_type=lowerCamelCase_	,							)
												_lowerCAmelCase  						=self.to_np(lowerCamelCase_					)
												_lowerCAmelCase  						=(input_np * 255).round() if output_type == """pil""" else input_np
												assert (
												    np.abs(in_np - out_np					).max() < 1e-6
												), F"decoded output does not match input for output_type {output_type}"






				def        lowerCAmelCase__			(				self     :    Any					):
								_lowerCAmelCase  						=VaeImageProcessor(do_resize=lowerCamelCase_	,							do_normalize=lowerCamelCase_					)
								_lowerCAmelCase  						=self.dummy_sample.cpu().numpy().transpose(0	,							2	,							3	,							1					)

								for output_type in ["pt", "np", "pil"]:
												_lowerCAmelCase  						=image_processor.postprocess(image_processor.preprocess(lowerCamelCase_					)	,							output_type=lowerCamelCase_					)

												_lowerCAmelCase  						=self.to_np(lowerCamelCase_					)
												_lowerCAmelCase  						=(input_np * 255).round() if output_type == """pil""" else input_np
												assert (
												    np.abs(in_np - out_np					).max() < 1e-6
												), F"decoded output does not match input for output_type {output_type}"






				def        lowerCAmelCase__			(				self     :    str					):
								_lowerCAmelCase  						=VaeImageProcessor(do_resize=lowerCamelCase_	,							do_normalize=lowerCamelCase_					)

								_lowerCAmelCase  						=self.dummy_sample.cpu().numpy().transpose(0	,							2	,							3	,							1					)
								_lowerCAmelCase  						=image_processor.numpy_to_pil(lowerCamelCase_					)

								for output_type in ["pt", "np", "pil"]:
												_lowerCAmelCase  						=image_processor.postprocess(image_processor.preprocess(lowerCamelCase_					)	,							output_type=lowerCamelCase_					)
												for i, o in zip(lowerCamelCase_	,							lowerCamelCase_					):
																_lowerCAmelCase  						=np.array(lowerCamelCase_					)
																_lowerCAmelCase  						=self.to_np(lowerCamelCase_					) if output_type == """pil""" else (self.to_np(lowerCamelCase_					) * 255).round()
																assert (
																    np.abs(in_np - out_np					).max() < 1e-6
																), F"decoded output does not match input for output_type {output_type}"






				def        lowerCAmelCase__			(				self     :    List[Any]					):
								_lowerCAmelCase  						=VaeImageProcessor(do_resize=lowerCamelCase_	,							do_normalize=lowerCamelCase_					)

								_lowerCAmelCase  						=self.dummy_sample
								_lowerCAmelCase  						=input_pt_ad.squeeze(0					)

								_lowerCAmelCase  						=image_processor.postprocess(
								    image_processor.preprocess(lowerCamelCase_					)	,							output_type="""np"""	,							)
								_lowerCAmelCase  						=image_processor.postprocess(
								    image_processor.preprocess(lowerCamelCase_					)	,							output_type="""np"""	,							)

								_lowerCAmelCase  						=self.to_np(self.dummy_sample					)
								_lowerCAmelCase  						=input_np_ad.squeeze(0					)

								_lowerCAmelCase  						=image_processor.postprocess(
								    image_processor.preprocess(lowerCamelCase_					)	,							output_type="""np"""	,							)
								_lowerCAmelCase  						=image_processor.postprocess(
								    image_processor.preprocess(lowerCamelCase_					)	,							output_type="""np"""	,							)

								assert np.abs(out_pt_ad - out_pt_ad					).max() < 1e-6
								assert np.abs(out_np_ad - out_np_ad					).max() < 1e-6






				def        lowerCAmelCase__			(				self     :    List[str]					):
								_lowerCAmelCase  						=VaeImageProcessor(do_resize=lowerCamelCase_	,							do_normalize=lowerCamelCase_					)

								_lowerCAmelCase  						=self.dummy_sample
								_lowerCAmelCase  						=list(lowerCamelCase_					)

								_lowerCAmelCase  						=image_processor.postprocess(
								    image_processor.preprocess(lowerCamelCase_					)	,							output_type="""np"""	,							)

								_lowerCAmelCase  						=image_processor.postprocess(
								    image_processor.preprocess(lowerCamelCase_					)	,							output_type="""np"""	,							)

								_lowerCAmelCase  						=self.to_np(self.dummy_sample					)
								list(lowerCamelCase_					)

								_lowerCAmelCase  						=image_processor.postprocess(
								    image_processor.preprocess(lowerCamelCase_					)	,							output_type="""np"""	,							)

								_lowerCAmelCase  						=image_processor.postprocess(
								    image_processor.preprocess(lowerCamelCase_					)	,							output_type="""np"""	,							)

								assert np.abs(out_pt_ad - out_pt_list					).max() < 1e-6
								assert np.abs(out_np_ad - out_np_list					).max() < 1e-6





from math import floor, sqrt

def 		snake_case_   (				lowercase__     :    int     ):






				'''simple docstring'''






				_lowerCAmelCase  						=0.0
				_lowerCAmelCase  						=1.0
				_lowerCAmelCase  						=int(sqrt(lowercase__     )     )
				_lowerCAmelCase  						=root
				_lowerCAmelCase  						=0
				while integer_part != 2 * root:
								_lowerCAmelCase  						=denominator * integer_part - numerator
								_lowerCAmelCase  						=(n - numerator**2) / denominator
								_lowerCAmelCase  						=int((root + numerator) / denominator     )
								period += 1
				return period

def 		snake_case_   (				lowercase__     :    int = 1_00_00     ):






				'''simple docstring'''






				_lowerCAmelCase  						=0
				for i in range(2       ,     n + 1     ):
								_lowerCAmelCase  						=sqrt(lowercase__     )
								if sr - floor(lowercase__     ) != 0 and continuous_fraction_period(lowercase__     ) % 2 == 1:
												count_odd_periods += 1
				return count_odd_periods


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

