


'''simple docstring'''


import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_layoutlm import LayoutLMTokenizer


UpperCAmelCase_		:       Union[str, Any]							       =		logging.get_logger(__name__)

UpperCAmelCase_		:       Optional[Any]							       =		{'vocab_file': 'vocab.txt', 'tokenizer_file': 'tokenizer.json'}

UpperCAmelCase_		:       Dict							       =		{
    'vocab_file': {
        'microsoft/layoutlm-base-uncased': (
            'https://huggingface.co/microsoft/layoutlm-base-uncased/resolve/main/vocab.txt'
        ),
        'microsoft/layoutlm-large-uncased': (
            'https://huggingface.co/microsoft/layoutlm-large-uncased/resolve/main/vocab.txt'
        ),
    },
    'tokenizer_file': {
        'microsoft/layoutlm-base-uncased': (
            'https://huggingface.co/microsoft/layoutlm-base-uncased/resolve/main/tokenizer.json'
        ),
        'microsoft/layoutlm-large-uncased': (
            'https://huggingface.co/microsoft/layoutlm-large-uncased/resolve/main/tokenizer.json'
        ),
    },
}

UpperCAmelCase_		:       List[Any]							       =		{
    'microsoft/layoutlm-base-uncased': 512,
    'microsoft/layoutlm-large-uncased': 512,
}

UpperCAmelCase_		:       Dict							       =		{
    'microsoft/layoutlm-base-uncased': {'do_lower_case': True},
    'microsoft/layoutlm-large-uncased': {'do_lower_case': True},
}





class    lowercase__  (						_snake_case ):





							'''simple docstring'''


							A_							:				Dict				     =  VOCAB_FILES_NAMES
							A_							:				List[Any]				     =  PRETRAINED_VOCAB_FILES_MAP
							A_							:				Union[str, Any]				     =  PRETRAINED_INIT_CONFIGURATION
							A_							:				int				     =  PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
							A_							:				Any				     =  LayoutLMTokenizer






							def __init__(   self   , __snake_case=None   , __snake_case=None   , __snake_case=True   , __snake_case="[UNK]"   , __snake_case="[SEP]"   , __snake_case="[PAD]"   , __snake_case="[CLS]"   , __snake_case="[MASK]"   , __snake_case=True   , __snake_case=None   , **__snake_case   , ):
											super().__init__(
											    __snake_case   , tokenizer_file=__snake_case   , do_lower_case=__snake_case   , unk_token=__snake_case   , sep_token=__snake_case   , pad_token=__snake_case   , cls_token=__snake_case   , mask_token=__snake_case   , tokenize_chinese_chars=__snake_case   , strip_accents=__snake_case   , **__snake_case   , )

											_SCREAMING_SNAKE_CASE			:	int							=				json.loads(self.backend_tokenizer.normalizer.__getstate__()  )
											if (
											    normalizer_state.get("""lowercase"""   , __snake_case  ) != do_lower_case
											    or normalizer_state.get("""strip_accents"""   , __snake_case  ) != strip_accents
											    or normalizer_state.get("""handle_chinese_chars"""   , __snake_case  ) != tokenize_chinese_chars
											):
															_SCREAMING_SNAKE_CASE			:	Tuple							=				getattr(__snake_case   , normalizer_state.pop("""type"""  )  )
															_SCREAMING_SNAKE_CASE			:	Union[str, Any]							=				do_lower_case
															_SCREAMING_SNAKE_CASE			:	List[str]							=				strip_accents
															_SCREAMING_SNAKE_CASE			:	Optional[int]							=				tokenize_chinese_chars
															_SCREAMING_SNAKE_CASE			:	str							=				normalizer_class(**__snake_case  )

											_SCREAMING_SNAKE_CASE			:	Optional[Any]							=				do_lower_case






							def UpperCAmelCase_     (   self   , __snake_case   , __snake_case=None  ):
											_SCREAMING_SNAKE_CASE			:	List[str]							=				[self.cls_token_id] + token_ids_a + [self.sep_token_id]

											if token_ids_a:
															output += token_ids_a + [self.sep_token_id]

											return output






							def UpperCAmelCase_     (   self   , __snake_case   , __snake_case = None  ):
											_SCREAMING_SNAKE_CASE			:	Optional[int]							=				[self.sep_token_id]
											_SCREAMING_SNAKE_CASE			:	List[str]							=				[self.cls_token_id]
											if token_ids_a is None:
															return len(cls + token_ids_a + sep  ) * [0]
											return len(cls + token_ids_a + sep  ) * [0] + len(token_ids_a + sep  ) * [1]






							def UpperCAmelCase_     (   self   , __snake_case   , __snake_case = None  ):
											_SCREAMING_SNAKE_CASE			:	Optional[int]							=				self._tokenizer.model.save(__snake_case   , name=__snake_case  )
											return tuple(__snake_case  )








'''simple docstring'''


def       snake_case_       (  SCREAMING_SNAKE_CASE__ = 1000					):







				"""simple docstring"""





				_SCREAMING_SNAKE_CASE			:	Union[str, Any]							=				[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)
				_SCREAMING_SNAKE_CASE			:	str							=				[0, 0, 6, 6, 5, 5, 5, 7, 6, 6]

				_SCREAMING_SNAKE_CASE			:	Any							=				0

				for i in range(1							,				n + 1					):
								if i < 1000:
												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 // 1000] + 8
				return count


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




