
'''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	:Optional[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													=      8 * i // 17, 2_792 * i  # along the diagonal
             __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      )









def _a					(			SCREAMING_SNAKE_CASE						:     int = 10_00						)       ->       int:

 """simple docstring"""






 __lowerCAmelCase:  Tuple        = [0, 3, 3, 5, 4, 4, 3, 5, 5, 4, 3, 6, 6, 8, 8, 7, 7, 9, 8, 8]
 # number of letters in twenty, thirty, ..., ninety (0 for numbers less than
 # 20 due to inconsistency in teens)
 __lowerCAmelCase:  List[Any]        = [0, 0, 6, 6, 5, 5, 5, 7, 6, 6]

 __lowerCAmelCase:  Dict        = 0

 for i in range(1       ,   n + 1						):
  if i < 10_00:
   if i >= 1_00:
    # add number of letters for "n hundred"
    count += ones_counts[i // 1_00] + 7

    if i % 1_00 != 0:
     # add number of letters for "and" if number is not multiple
     # of 100
     count += 3

   if 0 < i % 1_00 < 20:
    # add number of letters for one, two, three, ..., nineteen
    # (could be combined with below if not for inconsistency in
    # teens)
    count += ones_counts[i % 1_00]
   else:
    # add number of letters for twenty, twenty one, ..., ninety
    # nine
    count += ones_counts[i % 10]
    count += tens_counts[(i % 1_00 - i % 10) // 10]
  else:
   count += ones_counts[i // 10_00] + 8
 return count


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





