



'''simple docstring'''







import logging

# standard libraries
import sys

import numpy as np
import pytest  # type: ignore

# Custom/local libraries
from matrix import matrix_operation as matop

SCREAMING_SNAKE_CASE__     : Any				=   [[12, 10], [3, 9]]
SCREAMING_SNAKE_CASE__     : List[str]				=   [[3, 4], [7, 4]]
SCREAMING_SNAKE_CASE__     : List[str]				=   [[3, 0, 2], [2, 0, -2], [0, 1, 1]]
SCREAMING_SNAKE_CASE__     : Any				=   [[3, 0, -2], [2, 0, 2], [0, 1, 1]]
SCREAMING_SNAKE_CASE__     : List[str]				=   [[3, 0, 2], [2, 0, -2], [0, 1, 1], [2, 0, -2]]
SCREAMING_SNAKE_CASE__     : Union[str, Any]				=   [1]
SCREAMING_SNAKE_CASE__     : Tuple				=   [2]

SCREAMING_SNAKE_CASE__     : Tuple				=   logging.getLogger()
SCREAMING_SNAKE_CASE__     : Any				=   logging.DEBUG
SCREAMING_SNAKE_CASE__     : List[str]				=   logging.StreamHandler(sys.stdout)
logger.addHandler(stream_handler)







@pytest.mark.mat_ops
@pytest.mark.parametrize(
    ('mat1', 'mat2') ,		[(mat_a, mat_b), (mat_c, mat_d), (mat_d, mat_e), (mat_f, mat_h)]     )
def  SCREAMING_SNAKE_CASE__ (				SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE     ):
		if (np.array(SCREAMING_SNAKE_CASE     )).shape < (2, 2) or (np.array(SCREAMING_SNAKE_CASE     )).shape < (2, 2):
				with pytest.raises(SCREAMING_SNAKE_CASE     ):
						logger.info(F'\n\t{test_addition.__name__} returned integer'     )
						matop.add(SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE     )
		elif (np.array(SCREAMING_SNAKE_CASE     )).shape == (np.array(SCREAMING_SNAKE_CASE     )).shape:
				logger.info(F'\n\t{test_addition.__name__} with same matrix dims'     )
				SCREAMING_SNAKE_CASE_						:List[Any]										=      (np.array(SCREAMING_SNAKE_CASE     ) + np.array(SCREAMING_SNAKE_CASE     )).tolist()
				SCREAMING_SNAKE_CASE_						:int										=      matop.add(SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE     )
				assert theo == act
		else:
				with pytest.raises(SCREAMING_SNAKE_CASE     ):
						logger.info(F'\n\t{test_addition.__name__} with different matrix dims'     )
						matop.add(SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE     )







@pytest.mark.mat_ops
@pytest.mark.parametrize(
    ('mat1', 'mat2') ,		[(mat_a, mat_b), (mat_c, mat_d), (mat_d, mat_e), (mat_f, mat_h)]     )
def  SCREAMING_SNAKE_CASE__ (				SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE     ):
		if (np.array(SCREAMING_SNAKE_CASE     )).shape < (2, 2) or (np.array(SCREAMING_SNAKE_CASE     )).shape < (2, 2):
				with pytest.raises(SCREAMING_SNAKE_CASE     ):
						logger.info(F'\n\t{test_subtraction.__name__} returned integer'     )
						matop.subtract(SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE     )
		elif (np.array(SCREAMING_SNAKE_CASE     )).shape == (np.array(SCREAMING_SNAKE_CASE     )).shape:
				logger.info(F'\n\t{test_subtraction.__name__} with same matrix dims'     )
				SCREAMING_SNAKE_CASE_						:str										=      (np.array(SCREAMING_SNAKE_CASE     ) - np.array(SCREAMING_SNAKE_CASE     )).tolist()
				SCREAMING_SNAKE_CASE_						:Tuple										=      matop.subtract(SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE     )
				assert theo == act
		else:
				with pytest.raises(SCREAMING_SNAKE_CASE     ):
						logger.info(F'\n\t{test_subtraction.__name__} with different matrix dims'     )
						assert matop.subtract(SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE     )







@pytest.mark.mat_ops
@pytest.mark.parametrize(
    ('mat1', 'mat2') ,		[(mat_a, mat_b), (mat_c, mat_d), (mat_d, mat_e), (mat_f, mat_h)]     )
def  SCREAMING_SNAKE_CASE__ (				SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE     ):
		if (np.array(SCREAMING_SNAKE_CASE     )).shape < (2, 2) or (np.array(SCREAMING_SNAKE_CASE     )).shape < (2, 2):
				logger.info(F'\n\t{test_multiplication.__name__} returned integer'     )
				with pytest.raises(SCREAMING_SNAKE_CASE     ):
						matop.add(SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE     )
		elif (np.array(SCREAMING_SNAKE_CASE     )).shape == (np.array(SCREAMING_SNAKE_CASE     )).shape:
				logger.info(F'\n\t{test_multiplication.__name__} meets dim requirements'     )
				SCREAMING_SNAKE_CASE_						:Any										=      (np.matmul(SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE     )).tolist()
				SCREAMING_SNAKE_CASE_						:Any										=      matop.multiply(SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE     )
				assert theo == act
		else:
				with pytest.raises(SCREAMING_SNAKE_CASE     ):
						logger.info(
						    F'\n\t{test_multiplication.__name__} does not meet dim requirements'     )
						assert matop.subtract(SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE     )







@pytest.mark.mat_ops
def  SCREAMING_SNAKE_CASE__ (				):
		SCREAMING_SNAKE_CASE_						:str										=      (3.5 * np.array(SCREAMING_SNAKE_CASE     )).tolist()
		SCREAMING_SNAKE_CASE_						:Union[str, Any]										=      matop.scalar_multiply(SCREAMING_SNAKE_CASE ,		3.5     )
		assert theo == act







@pytest.mark.mat_ops
def  SCREAMING_SNAKE_CASE__ (				):
		SCREAMING_SNAKE_CASE_						:Optional[int]										=      (np.identity(5     )).tolist()
		SCREAMING_SNAKE_CASE_						:Any										=      matop.identity(5     )
		assert theo == act







@pytest.mark.mat_ops
@pytest.mark.parametrize('mat' ,		[mat_a, mat_b, mat_c, mat_d, mat_e, mat_f]     )
def  SCREAMING_SNAKE_CASE__ (				SCREAMING_SNAKE_CASE     ):
		if (np.array(SCREAMING_SNAKE_CASE     )).shape < (2, 2):
				with pytest.raises(SCREAMING_SNAKE_CASE     ):
						logger.info(F'\n\t{test_transpose.__name__} returned integer'     )
						matop.transpose(SCREAMING_SNAKE_CASE     )
		else:
				SCREAMING_SNAKE_CASE_						:Union[str, Any]										=      (np.transpose(SCREAMING_SNAKE_CASE     )).tolist()
				SCREAMING_SNAKE_CASE_						:Dict										=      matop.transpose(SCREAMING_SNAKE_CASE ,		return_map=SCREAMING_SNAKE_CASE     )
				assert theo == act

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




