'''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_video_inputs


if is_torch_available():
 import torch

if is_vision_available():
 from PIL import Image

 from transformers import VideoMAEImageProcessor


class    UpperCAmelCase__	(							unittest.TestCase      ):






   """simple docstring"""
   def __init__(self							,					_a							,					_a=7							,					_a=3							,					_a=10							,					_a=18							,					_a=30							,					_a=400							,					_a=True							,					_a=None							,					_a=True							,					_a=[0.5, 0.5, 0.5]							,					_a=[0.5, 0.5, 0.5]							,					_a=None							,					)     ->  List[str]:
        lowercase_       :							Tuple  					=       size if size is not None else {'shortest_edge': 18}
        lowercase_       :							int  					=       crop_size if crop_size is not None else {'height': 18, 'width': 18}

        lowercase_       :							int  					=       parent
        lowercase_       :							Tuple  					=       batch_size
        lowercase_       :							Dict  					=       num_channels
        lowercase_       :							Dict  					=       num_frames
        lowercase_       :							Dict  					=       image_size
        lowercase_       :							Union[str, Any]  					=       min_resolution
        lowercase_       :							List[str]  					=       max_resolution
        lowercase_       :							int  					=       do_resize
        lowercase_       :							Optional[Any]  					=       size
        lowercase_       :							List[Any]  					=       do_normalize
        lowercase_       :							Union[str, Any]  					=       image_mean
        lowercase_       :							Dict  					=       image_std
        lowercase_       :							int  					=       crop_size





   def 		_lowerCamelCase			(self					)     ->  List[Any]:
        return {
            "image_mean": self.image_mean,
            "image_std": self.image_std,
            "do_normalize": self.do_normalize,
            "do_resize": self.do_resize,
            "size": self.size,
            "crop_size": self.crop_size,
        }



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






   """simple docstring"""
   A				:							Any			     =     VideoMAEImageProcessor if is_vision_available() else None
   def 		_lowerCamelCase			(self					)     ->  Dict:
        lowercase_       :							Optional[int]  					=       VideoMAEImageProcessingTester(self					)
   @property
   def 		_lowerCamelCase			(self					)     ->  str:
        return self.image_processor_tester.prepare_image_processor_dict()
   def 		_lowerCamelCase			(self					)     ->  Optional[Any]:
        lowercase_       :							Tuple  					=       self.image_processing_class(**self.image_processor_dict					)
        self.assertTrue(hasattr(_a							,					'image_mean'					)					)
        self.assertTrue(hasattr(_a							,					'image_std'					)					)
        self.assertTrue(hasattr(_a							,					'do_normalize'					)					)
        self.assertTrue(hasattr(_a							,					'do_resize'					)					)
        self.assertTrue(hasattr(_a							,					'do_center_crop'					)					)
        self.assertTrue(hasattr(_a							,					'size'					)					)
   def 		_lowerCamelCase			(self					)     ->  Union[str, Any]:
        lowercase_       :							Optional[Any]  					=       self.image_processing_class.from_dict(self.image_processor_dict					)
        self.assertEqual(image_processor.size							,					{'shortest_edge': 18}					)
        self.assertEqual(image_processor.crop_size							,					{'height': 18, 'width': 18}					)

        lowercase_       :							Optional[int]  					=       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					)     ->  List[str]:
        pass
   def 		_lowerCamelCase			(self					)     ->  str:
        # Initialize image_processing
        lowercase_       :							Optional[int]  					=       self.image_processing_class(**self.image_processor_dict					)
        # create random PIL videos
        lowercase_       :							str  					=       prepare_video_inputs(self.image_processor_tester							,					equal_resolution=_a					)
        for video in video_inputs:
             self.assertIsInstance(_a							,					_a					)
             self.assertIsInstance(video[0]							,					Image.Image					)

        # Test not batched input
        lowercase_       :							Any  					=       image_processing(video_inputs[0]							,					return_tensors='pt'					).pixel_values
        self.assertEqual(
            encoded_videos.shape							,					(
                1,
                self.image_processor_tester.num_frames,
                self.image_processor_tester.num_channels,
                self.image_processor_tester.crop_size['height'],
                self.image_processor_tester.crop_size['width'],
            )							,					)

        # Test batched
        lowercase_       :							List[Any]  					=       image_processing(_a							,					return_tensors='pt'					).pixel_values
        self.assertEqual(
            encoded_videos.shape							,					(
                self.image_processor_tester.batch_size,
                self.image_processor_tester.num_frames,
                self.image_processor_tester.num_channels,
                self.image_processor_tester.crop_size['height'],
                self.image_processor_tester.crop_size['width'],
            )							,					)
   def 		_lowerCamelCase			(self					)     ->  Optional[Any]:
        # Initialize image_processing
        lowercase_       :							Optional[Any]  					=       self.image_processing_class(**self.image_processor_dict					)
        # create random numpy tensors
        lowercase_       :							Dict  					=       prepare_video_inputs(self.image_processor_tester							,					equal_resolution=_a							,					numpify=_a					)
        for video in video_inputs:
             self.assertIsInstance(_a							,					_a					)
             self.assertIsInstance(video[0]							,					np.ndarray					)

        # Test not batched input
        lowercase_       :							Dict  					=       image_processing(video_inputs[0]							,					return_tensors='pt'					).pixel_values
        self.assertEqual(
            encoded_videos.shape							,					(
                1,
                self.image_processor_tester.num_frames,
                self.image_processor_tester.num_channels,
                self.image_processor_tester.crop_size['height'],
                self.image_processor_tester.crop_size['width'],
            )							,					)

        # Test batched
        lowercase_       :							str  					=       image_processing(_a							,					return_tensors='pt'					).pixel_values
        self.assertEqual(
            encoded_videos.shape							,					(
                self.image_processor_tester.batch_size,
                self.image_processor_tester.num_frames,
                self.image_processor_tester.num_channels,
                self.image_processor_tester.crop_size['height'],
                self.image_processor_tester.crop_size['width'],
            )							,					)





   def 		_lowerCamelCase			(self					)     ->  str:
        # Initialize image_processing
        lowercase_       :							Dict  					=       self.image_processing_class(**self.image_processor_dict					)
        # create random PyTorch tensors
        lowercase_       :							Union[str, Any]  					=       prepare_video_inputs(self.image_processor_tester							,					equal_resolution=_a							,					torchify=_a					)
        for video in video_inputs:
             self.assertIsInstance(_a							,					_a					)
             self.assertIsInstance(video[0]							,					torch.Tensor					)

        # Test not batched input
        lowercase_       :							Tuple  					=       image_processing(video_inputs[0]							,					return_tensors='pt'					).pixel_values
        self.assertEqual(
            encoded_videos.shape							,					(
                1,
                self.image_processor_tester.num_frames,
                self.image_processor_tester.num_channels,
                self.image_processor_tester.crop_size['height'],
                self.image_processor_tester.crop_size['width'],
            )							,					)

        # Test batched
        lowercase_       :							Union[str, Any]  					=       image_processing(_a							,					return_tensors='pt'					).pixel_values
        self.assertEqual(
            encoded_videos.shape							,					(
                self.image_processor_tester.batch_size,
                self.image_processor_tester.num_frames,
                self.image_processor_tester.num_channels,
                self.image_processor_tester.crop_size['height'],
                self.image_processor_tester.crop_size['width'],
            )							,					)





'''simple docstring'''




def _UpperCamelCase (							SCREAMING_SNAKE_CASE_ = 1_000				):
     lowercase_       :							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)
     lowercase_       :							List[Any]  					=       [0, 0, 6, 6, 5, 5, 5, 7, 6, 6]

     lowercase_       :							Optional[Any]  					=       0

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

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

               if 0 < i % 100 < 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 % 100]
               else:
                    # add number of letters for twenty, twenty one, ..., ninety
                    # nine
                    count += ones_counts[i % 10]
                    count += tens_counts[(i % 100 - i % 10) // 10]
          else:
               count += ones_counts[i // 1_000] + 8
     return count


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




