






import shutil
import tempfile
import unittest

import numpy as np
import pytest

from transformers.testing_utils import require_vision
from transformers.utils import is_vision_available


if is_vision_available():
	from PIL import Image

	from transformers import AutoProcessor, BertTokenizer, BlipImageProcessor, BlipProcessor, PreTrainedTokenizerFast


@require_vision
class    _lowerCAmelCase			(		unittest.TestCase      ):



				"""simple docstring"""



				def 					__magic_name__							(      self    :    Optional[int]):






											'''simple docstring'''







											snake_case__	  =       tempfile.mkdtemp()

											snake_case__	  =       BlipImageProcessor()
											snake_case__	  =       BertTokenizer.from_pretrained("""hf-internal-testing/tiny-random-BertModel""")

											snake_case__	  =       BlipProcessor(UpperCamelCase__			,		UpperCamelCase__)

											processor.save_pretrained(self.tmpdirname)



				def 					__magic_name__							(      self    :    Optional[int]			,		**UpperCamelCase__    :    Optional[int]):






											'''simple docstring'''







											return AutoProcessor.from_pretrained(self.tmpdirname			,		**UpperCamelCase__).tokenizer



				def 					__magic_name__							(      self    :    List[str]			,		**UpperCamelCase__    :    List[str]):






											'''simple docstring'''







											return AutoProcessor.from_pretrained(self.tmpdirname			,		**UpperCamelCase__).image_processor



				def 					__magic_name__							(      self    :    Dict):






											'''simple docstring'''







											shutil.rmtree(self.tmpdirname)



				def 					__magic_name__							(      self    :    Tuple):






											'''simple docstring'''







											snake_case__	  =       [np.random.randint(2_5_5			,		size=(3, 3_0, 4_0_0)			,		dtype=np.uinta)]

											snake_case__	  =       [Image.fromarray(np.moveaxis(UpperCamelCase__			,		0			,		-1)) for x in image_inputs]

											return image_inputs



				def 					__magic_name__							(      self    :    Dict):






											'''simple docstring'''







											snake_case__	  =       BlipProcessor(tokenizer=self.get_tokenizer()			,		image_processor=self.get_image_processor())
											processor.save_pretrained(self.tmpdirname)

											snake_case__	  =       self.get_tokenizer(bos_token="""(BOS)"""			,		eos_token="""(EOS)""")
											snake_case__	  =       self.get_image_processor(do_normalize=UpperCamelCase__			,		padding_value=1.0)

											snake_case__	  =       BlipProcessor.from_pretrained(
											    self.tmpdirname			,		bos_token="""(BOS)"""			,		eos_token="""(EOS)"""			,		do_normalize=UpperCamelCase__			,		padding_value=1.0)

											self.assertEqual(processor.tokenizer.get_vocab()			,		tokenizer_add_kwargs.get_vocab())
											self.assertIsInstance(processor.tokenizer			,		UpperCamelCase__)

											self.assertEqual(processor.image_processor.to_json_string()			,		image_processor_add_kwargs.to_json_string())
											self.assertIsInstance(processor.image_processor			,		UpperCamelCase__)



				def 					__magic_name__							(      self    :    Union[str, Any]):






											'''simple docstring'''







											snake_case__	  =       self.get_image_processor()
											snake_case__	  =       self.get_tokenizer()

											snake_case__	  =       BlipProcessor(tokenizer=UpperCamelCase__			,		image_processor=UpperCamelCase__)

											snake_case__	  =       self.prepare_image_inputs()

											snake_case__	  =       image_processor(UpperCamelCase__			,		return_tensors="""np""")
											snake_case__	  =       processor(images=UpperCamelCase__			,		return_tensors="""np""")

											for key in input_feat_extract.keys():
																		self.assertAlmostEqual(input_feat_extract[key].sum()			,		input_processor[key].sum()			,		delta=1E-2)



				def 					__magic_name__							(      self    :    List[str]):






											'''simple docstring'''







											snake_case__	  =       self.get_image_processor()
											snake_case__	  =       self.get_tokenizer()

											snake_case__	  =       BlipProcessor(tokenizer=UpperCamelCase__			,		image_processor=UpperCamelCase__)

											snake_case__	  =       """lower newer"""

											snake_case__	  =       processor(text=UpperCamelCase__)

											snake_case__	  =       tokenizer(UpperCamelCase__			,		return_token_type_ids=UpperCamelCase__)

											for key in encoded_tok.keys():
																		self.assertListEqual(encoded_tok[key]			,		encoded_processor[key])



				def 					__magic_name__							(      self    :    Tuple):






											'''simple docstring'''







											snake_case__	  =       self.get_image_processor()
											snake_case__	  =       self.get_tokenizer()

											snake_case__	  =       BlipProcessor(tokenizer=UpperCamelCase__			,		image_processor=UpperCamelCase__)

											snake_case__	  =       """lower newer"""
											snake_case__	  =       self.prepare_image_inputs()

											snake_case__	  =       processor(text=UpperCamelCase__			,		images=UpperCamelCase__)

											self.assertListEqual(list(inputs.keys())			,		["""pixel_values""", """input_ids""", """attention_mask"""])

											# test if it raises when no input is passed
											with pytest.raises(UpperCamelCase__):
																		processor()



				def 					__magic_name__							(      self    :    Optional[Any]):






											'''simple docstring'''







											snake_case__	  =       self.get_image_processor()
											snake_case__	  =       self.get_tokenizer()

											snake_case__	  =       BlipProcessor(tokenizer=UpperCamelCase__			,		image_processor=UpperCamelCase__)

											snake_case__	  =       [[1, 4, 5, 8, 1, 0, 8], [3, 4, 3, 1, 1, 8, 9]]

											snake_case__	  =       processor.batch_decode(UpperCamelCase__)
											snake_case__	  =       tokenizer.batch_decode(UpperCamelCase__)

											self.assertListEqual(UpperCamelCase__			,		UpperCamelCase__)



				def 					__magic_name__							(      self    :    List[str]):






											'''simple docstring'''







											snake_case__	  =       self.get_image_processor()
											snake_case__	  =       self.get_tokenizer()

											snake_case__	  =       BlipProcessor(tokenizer=UpperCamelCase__			,		image_processor=UpperCamelCase__)

											snake_case__	  =       """lower newer"""
											snake_case__	  =       self.prepare_image_inputs()

											snake_case__	  =       processor(text=UpperCamelCase__			,		images=UpperCamelCase__)

											# For now the processor supports only ['pixel_values', 'input_ids', 'attention_mask']
											self.assertListEqual(list(inputs.keys())			,		["""pixel_values""", """input_ids""", """attention_mask"""])








def _UpperCAmelCase   (	a						:	int = 1000 ):
							snake_case__  , snake_case__	  =       1, 1
							snake_case__	  =       2
							while True:
														snake_case__	  =       0
														snake_case__	  =       fa + fa
														snake_case__  , snake_case__	  =       fa, f
														index += 1
														for _ in str(a ):
																					i += 1
														if i == n:
																					break
							return index


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