




"""simple docstring"""




import unittest

import numpy as np

from transformers.testing_utils import require_torch, require_vision
from transformers.utils import is_torch_available, is_vision_available

from ...test_image_processing_common import ImageProcessingSavingTestMixin, prepare_image_inputs


if is_torch_available():
					import torch

if is_vision_available():
					from PIL import Image

					from transformers import MobileNetVaImageProcessor






class 					__magic_name__							( unittest.TestCase       ):






				'''simple docstring'''





				def __init__( self	,				_a	,				_a=7	,				_a=3	,				_a=18	,				_a=30	,				_a=400	,				_a=True	,				_a=None	,				_a=True	,				_a=None	,				):





							"""simple docstring"""
							lowerCamelCase       =      size if size is not None else {"""shortest_edge""": 20}
							lowerCamelCase       =      crop_size if crop_size is not None else {"""height""": 18, """width""": 18}
							lowerCamelCase       =      parent
							lowerCamelCase       =      batch_size
							lowerCamelCase       =      num_channels
							lowerCamelCase       =      image_size
							lowerCamelCase       =      min_resolution
							lowerCamelCase       =      max_resolution
							lowerCamelCase       =      do_resize
							lowerCamelCase       =      size
							lowerCamelCase       =      do_center_crop
							lowerCamelCase       =      crop_size





				def      _lowerCAmelCase       ( self				):





							"""simple docstring"""
							return {
							    "do_resize": self.do_resize,
							    "size": self.size,
							    "do_center_crop": self.do_center_crop,
							    "crop_size": self.crop_size,
							}






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






				'''simple docstring'''
				__UpperCamelCase    						=		MobileNetVaImageProcessor if is_vision_available() else None





				def      _lowerCAmelCase       ( self				):





							"""simple docstring"""
							lowerCamelCase       =      MobileNetVaImageProcessingTester(self				)





				@property
				def      _lowerCAmelCase       ( self				):





							"""simple docstring"""
							return self.image_processor_tester.prepare_image_processor_dict()





				def      _lowerCAmelCase       ( self				):





							"""simple docstring"""
							lowerCamelCase       =      self.image_processing_class(**self.image_processor_dict				)
							self.assertTrue(hasattr(_a	,				"""do_resize"""				)				)
							self.assertTrue(hasattr(_a	,				"""size"""				)				)
							self.assertTrue(hasattr(_a	,				"""do_center_crop"""				)				)
							self.assertTrue(hasattr(_a	,				"""crop_size"""				)				)





				def      _lowerCAmelCase       ( self				):





							"""simple docstring"""
							lowerCamelCase       =      self.image_processing_class.from_dict(self.image_processor_dict				)
							self.assertEqual(image_processor.size	,				{"""shortest_edge""": 20}				)
							self.assertEqual(image_processor.crop_size	,				{"""height""": 18, """width""": 18}				)

							lowerCamelCase       =      self.image_processing_class.from_dict(self.image_processor_dict	,				size=42	,				crop_size=84				)
							self.assertEqual(image_processor.size	,				{"""shortest_edge""": 42}				)
							self.assertEqual(image_processor.crop_size	,				{"""height""": 84, """width""": 84}				)





				def      _lowerCAmelCase       ( self				):





							"""simple docstring"""
							pass





				def      _lowerCAmelCase       ( self				):





							"""simple docstring"""
							# Initialize image_processing
							lowerCamelCase       =      self.image_processing_class(**self.image_processor_dict				)
							# create random PIL images
							lowerCamelCase       =      prepare_image_inputs(self.image_processor_tester	,				equal_resolution=_a				)
							for image in image_inputs:
										self.assertIsInstance(_a	,				Image.Image				)

							# Test not batched input
							lowerCamelCase       =      image_processing(image_inputs[0]	,				return_tensors="""pt"""				).pixel_values
							self.assertEqual(
							    encoded_images.shape	,				(
							        1,
							        self.image_processor_tester.num_channels,
							        self.image_processor_tester.crop_size["""height"""],
							        self.image_processor_tester.crop_size["""width"""],
							    )	,				)

							# Test batched
							lowerCamelCase       =      image_processing(_a	,				return_tensors="""pt"""				).pixel_values
							self.assertEqual(
							    encoded_images.shape	,				(
							        self.image_processor_tester.batch_size,
							        self.image_processor_tester.num_channels,
							        self.image_processor_tester.crop_size["""height"""],
							        self.image_processor_tester.crop_size["""width"""],
							    )	,				)





				def      _lowerCAmelCase       ( self				):





							"""simple docstring"""
							# Initialize image_processing
							lowerCamelCase       =      self.image_processing_class(**self.image_processor_dict				)
							# create random numpy tensors
							lowerCamelCase       =      prepare_image_inputs(self.image_processor_tester	,				equal_resolution=_a	,				numpify=_a				)
							for image in image_inputs:
										self.assertIsInstance(_a	,				np.ndarray				)

							# Test not batched input
							lowerCamelCase       =      image_processing(image_inputs[0]	,				return_tensors="""pt"""				).pixel_values
							self.assertEqual(
							    encoded_images.shape	,				(
							        1,
							        self.image_processor_tester.num_channels,
							        self.image_processor_tester.crop_size["""height"""],
							        self.image_processor_tester.crop_size["""width"""],
							    )	,				)

							# Test batched
							lowerCamelCase       =      image_processing(_a	,				return_tensors="""pt"""				).pixel_values
							self.assertEqual(
							    encoded_images.shape	,				(
							        self.image_processor_tester.batch_size,
							        self.image_processor_tester.num_channels,
							        self.image_processor_tester.crop_size["""height"""],
							        self.image_processor_tester.crop_size["""width"""],
							    )	,				)





				def      _lowerCAmelCase       ( self				):





							"""simple docstring"""
							# Initialize image_processing
							lowerCamelCase       =      self.image_processing_class(**self.image_processor_dict				)
							# create random PyTorch tensors
							lowerCamelCase       =      prepare_image_inputs(self.image_processor_tester	,				equal_resolution=_a	,				torchify=_a				)
							for image in image_inputs:
										self.assertIsInstance(_a	,				torch.Tensor				)

							# Test not batched input
							lowerCamelCase       =      image_processing(image_inputs[0]	,				return_tensors="""pt"""				).pixel_values
							self.assertEqual(
							    encoded_images.shape	,				(
							        1,
							        self.image_processor_tester.num_channels,
							        self.image_processor_tester.crop_size["""height"""],
							        self.image_processor_tester.crop_size["""width"""],
							    )	,				)

							# Test batched
							lowerCamelCase       =      image_processing(_a	,				return_tensors="""pt"""				).pixel_values
							self.assertEqual(
							    encoded_images.shape	,				(
							        self.image_processor_tester.batch_size,
							        self.image_processor_tester.num_channels,
							        self.image_processor_tester.crop_size["""height"""],
							        self.image_processor_tester.crop_size["""width"""],
							    )	,				)









"""simple docstring"""




def 					a__				(       snake_case__ = 1_00_00_00       )		->      int:
			lowerCamelCase       =      1
			lowerCamelCase       =      1
			lowerCamelCase       =      {1: 1}

			for inputa in range(2 ,				snake_case__       ):
						lowerCamelCase       =      0
						lowerCamelCase       =      inputa

						while True:
									if number in counters:
												counter += counters[number]
												break
									if number % 2 == 0:
												number //= 2
												counter += 1
									else:
												lowerCamelCase       =      (3 * number) + 1
												counter += 1

						if inputa not in counters:
									lowerCamelCase       =      counter

						if counter > pre_counter:
									lowerCamelCase       =      inputa
									lowerCamelCase       =      counter
			return largest_number


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



