




"""simple docstring"""




import os
import tempfile
import unittest
import uuid
from pathlib import Path

from transformers.testing_utils import get_tests_dir, require_soundfile, require_torch, require_vision
from transformers.tools.agent_types import AgentAudio, AgentImage, AgentText
from transformers.utils import is_soundfile_availble, is_torch_available, is_vision_available


if is_torch_available():
					import torch

if is_soundfile_availble():
					import soundfile as sf

if is_vision_available():
					from PIL import Image



def     a__ (				snake_case__=""				)						->					str:
			lowerCamelCase			      =					tempfile.mkdtemp()
			return os.path.join(snake_case__       , str(uuid.uuida()				) + suffix				)






@require_soundfile
@require_torch
class     __magic_name__							(       unittest.TestCase				):






				'''simple docstring'''





				def    _lowerCAmelCase				(       self ):





							"""simple docstring"""
							lowerCamelCase			      =					torch.rand(12		, dtype=torch.floataa ) - 0.5
							lowerCamelCase			      =					AgentAudio(_a )
							lowerCamelCase			      =					str(agent_type.to_string() )

							# Ensure that the tensor and the agent_type's tensor are the same
							self.assertTrue(torch.allclose(_a		, agent_type.to_raw()		, atol=1e-4 ) )

							del agent_type

							# Ensure the path remains even after the object deletion
							self.assertTrue(os.path.exists(_a ) )

							# Ensure that the file contains the same value as the original tensor
							lowerCamelCase      ,   lowerCamelCase			      =					sf.read(_a )
							self.assertTrue(torch.allclose(_a		, torch.tensor(_a )		, atol=1e-4 ) )





				def    _lowerCAmelCase				(       self ):





							"""simple docstring"""
							lowerCamelCase			      =					torch.rand(12		, dtype=torch.floataa ) - 0.5
							lowerCamelCase			      =					get_new_path(suffix=""".wav""" )
							sf.write(_a		, _a		, 16_000 )

							lowerCamelCase			      =					AgentAudio(_a )

							self.assertTrue(torch.allclose(_a		, agent_type.to_raw()		, atol=1e-4 ) )
							self.assertEqual(agent_type.to_string()		, _a )






@require_vision
@require_torch
class     __magic_name__							(       unittest.TestCase				):






				'''simple docstring'''





				def    _lowerCAmelCase				(       self ):





							"""simple docstring"""
							lowerCamelCase			      =					torch.randint(0		, 256		, (64, 64, 3) )
							lowerCamelCase			      =					AgentImage(_a )
							lowerCamelCase			      =					str(agent_type.to_string() )

							# Ensure that the tensor and the agent_type's tensor are the same
							self.assertTrue(torch.allclose(_a		, agent_type._tensor		, atol=1e-4 ) )

							self.assertIsInstance(agent_type.to_raw()		, Image.Image )

							# Ensure the path remains even after the object deletion
							del agent_type
							self.assertTrue(os.path.exists(_a ) )





				def    _lowerCAmelCase				(       self ):





							"""simple docstring"""
							lowerCamelCase			      =					Path(get_tests_dir("""fixtures/tests_samples/COCO""" ) ) / """000000039769.png"""
							lowerCamelCase			      =					Image.open(_a )
							lowerCamelCase			      =					AgentImage(_a )

							self.assertTrue(path.samefile(agent_type.to_string() ) )
							self.assertTrue(image == agent_type.to_raw() )

							# Ensure the path remains even after the object deletion
							del agent_type
							self.assertTrue(os.path.exists(_a ) )





				def    _lowerCAmelCase				(       self ):





							"""simple docstring"""
							lowerCamelCase			      =					Path(get_tests_dir("""fixtures/tests_samples/COCO""" ) ) / """000000039769.png"""
							lowerCamelCase			      =					Image.open(_a )
							lowerCamelCase			      =					AgentImage(_a )

							self.assertFalse(path.samefile(agent_type.to_string() ) )
							self.assertTrue(image == agent_type.to_raw() )

							# Ensure the path remains even after the object deletion
							del agent_type
							self.assertTrue(os.path.exists(_a ) )






class     __magic_name__							(       unittest.TestCase				):






				'''simple docstring'''





				def    _lowerCAmelCase				(       self ):





							"""simple docstring"""
							lowerCamelCase			      =					"""Hey!"""
							lowerCamelCase			      =					AgentText(_a )

							self.assertEqual(_a		, agent_type.to_string() )
							self.assertEqual(_a		, agent_type.to_raw() )
							self.assertEqual(_a		, _a )









"""simple docstring"""




from collections.abc import Generator



def     a__ (				)						->					Generator[int, None, None]:
			lowerCamelCase      ,   lowerCamelCase			      =					0, 1
			while True:
						lowerCamelCase      ,   lowerCamelCase			      =					b, a + b
						yield b



def     a__ (				snake_case__ = 10_00				)						->					int:
			lowerCamelCase			      =					1
			lowerCamelCase			      =					fibonacci_generator()
			while len(str(next(snake_case__				)				)				) < n:
						answer += 1
			return answer + 1


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



