





"""simple docstring"""




import unittest

from huggingface_hub import hf_hub_download

from transformers import MODEL_FOR_VIDEO_CLASSIFICATION_MAPPING, VideoMAEFeatureExtractor
from transformers.pipelines import VideoClassificationPipeline, pipeline
from transformers.testing_utils import (
    is_pipeline_test,
    nested_simplify,
    require_decord,
    require_tf,
    require_torch,
    require_torch_or_tf,
    require_vision,
)

from .test_pipelines_common import ANY






@is_pipeline_test
@require_torch_or_tf
@require_vision
@require_decord
class 					__magic_name__							( unittest.TestCase       ):






				'''simple docstring'''
				__UpperCamelCase    						=		MODEL_FOR_VIDEO_CLASSIFICATION_MAPPING





				def      _lowerCAmelCase       ( self	,				_a	,				_a	,				_a				):





							"""simple docstring"""
							lowerCamelCase       =      hf_hub_download(
							    repo_id="""nateraw/video-demo"""	,				filename="""archery.mp4"""	,				repo_type="""dataset"""				)
							lowerCamelCase       =      VideoClassificationPipeline(model=__lowerCamelCase	,				image_processor=__lowerCamelCase	,				top_k=2				)
							lowerCamelCase       =      [
							    example_video_filepath,
							    "https://huggingface.co/datasets/nateraw/video-demo/resolve/main/archery.mp4",
							]
							return video_classifier, examples





				def      _lowerCAmelCase       ( self	,				_a	,				_a				):





							"""simple docstring"""



							for example in examples:
										lowerCamelCase       =      video_classifier(__lowerCamelCase				)

										self.assertEqual(
										    __lowerCamelCase	,				[
										        {"""score""": ANY(__lowerCamelCase				), """label""": ANY(__lowerCamelCase				)},
										        {"""score""": ANY(__lowerCamelCase				), """label""": ANY(__lowerCamelCase				)},
										    ]	,				)





				@require_torch
				def      _lowerCAmelCase       ( self				):





							"""simple docstring"""
							lowerCamelCase       =      "hf-internal-testing/tiny-random-VideoMAEForVideoClassification"
							lowerCamelCase       =      VideoMAEFeatureExtractor(
							    size={"""shortest_edge""": 10}	,				crop_size={"""height""": 10, """width""": 10}				)
							lowerCamelCase       =      pipeline(
							    """video-classification"""	,				model=__lowerCamelCase	,				feature_extractor=__lowerCamelCase	,				frame_sampling_rate=4				)

							lowerCamelCase       =      hf_hub_download(repo_id="""nateraw/video-demo"""	,				filename="""archery.mp4"""	,				repo_type="""dataset"""				)
							lowerCamelCase       =      video_classifier(__lowerCamelCase	,				top_k=2				)
							self.assertEqual(
							    nested_simplify(__lowerCamelCase	,				decimals=4				)	,				[{"""score""": 0.5_199, """label""": """LABEL_0"""}, {"""score""": 0.4_801, """label""": """LABEL_1"""}]	,				)

							lowerCamelCase       =      video_classifier(
							    [
							        video_file_path,
							        video_file_path,
							    ]	,				top_k=2	,				)
							self.assertEqual(
							    nested_simplify(__lowerCamelCase	,				decimals=4				)	,				[
							        [{"""score""": 0.5_199, """label""": """LABEL_0"""}, {"""score""": 0.4_801, """label""": """LABEL_1"""}],
							        [{"""score""": 0.5_199, """label""": """LABEL_0"""}, {"""score""": 0.4_801, """label""": """LABEL_1"""}],
							    ]	,				)





				@require_tf
				def      _lowerCAmelCase       ( self				):





							"""simple docstring"""
							pass









"""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())))



