
'''simple docstring'''





import os
import unittest

from transformers import is_torch_available
from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow, torch_device


if is_torch_available():
 import torch

 from transformers import GPTaLMHeadModel


@require_torch
@require_sentencepiece
@require_tokenizers
class 			UpperCamelCase__	(     unittest.TestCase):






 @slow
 @unittest.skip('Model is not available.'      )
 def 						lowercase_    (      self	:List[Any]      )					->      Union[str, Any]:







       '''simple docstring'''



       __A													=      'nvidia/megatron-gpt2-345m/'
       if "MYDIR" in os.environ:
             __A													=      os.path.join(os.environ['MYDIR']						,					_A      )
       __A													=      GPTaLMHeadModel.from_pretrained(_A      )
       model.to(_A      )
       model.half()

       __A													=      torch.tensor(
           [[101, 7_110, 1_005, 1_056, 2_023, 11_333, 17_413, 1_029, 102]]						,					device=_A						,					dtype=torch.long						,					)

       with torch.no_grad():
             __A													=      model(_A      ).logits

       __A													=      torch.Size((1, 9, 50_257)      )
       self.assertEqual(output.shape						,					_A      )

       __A													=      torch.tensor(
           [
               4.9_414,
               -0.2_920,
               -1.2_148,
               -4.0_273,
               -0.5_161,
               -5.2_109,
               -1.2_412,
               -1.8_301,
               -1.7_734,
               -4.7_148,
               -0.2_317,
               -1.0_811,
               -2.1_777,
               0.4_141,
               -3.7_969,
               -4.0_586,
               -2.5_332,
               -3.3_809,
               4.3_867,
           ]						,					device=_A						,					dtype=torch.half						,					)

       for i in range(19      ):
             __A						,   __A													=      8 * i // 17, 2_792 * i  # along the diagonal
             __A						,   __A													=      output[0, r, c], expected_diag[i]
             __A													=      F'row={r} col={c} computed={computed} expected={expected}'
             self.assertAlmostEqual(_A						,					_A						,					delta=1E-4						,					msg=_A      )









from __future__ import annotations

_lowerCamelCase							={1: 1}







def      snake_case__							(  lowerCAmelCase_     ):





     """simple docstring"""







     if n in COLLATZ_SEQUENCE_LENGTHS:
          return COLLATZ_SEQUENCE_LENGTHS[n]
     SCREAMING_SNAKE_CASE 		=n // 2 if n % 2 == 0 else 3 * n + 1
     SCREAMING_SNAKE_CASE 		=collatz_sequence_length(lowerCAmelCase_     ) + 1
     SCREAMING_SNAKE_CASE 		=sequence_length
     return sequence_length







def      snake_case__							(  lowerCAmelCase_ = 1000000     ):





     """simple docstring"""







     SCREAMING_SNAKE_CASE 		=max((collatz_sequence_length(lowerCAmelCase_     ), i) for i in range(1,       lowerCAmelCase_     )     )
     return result[1]


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

