





'''simple docstring'''






from collections import namedtuple

snake_case_     			=						namedtuple("""from_to""", """from_ to""")

snake_case_     			=						{
    """millimeter""": """mm""",
    """centimeter""": """cm""",
    """meter""": """m""",
    """kilometer""": """km""",
    """inch""": """in""",
    """inche""": """in""",  # Trailing 's' has been stripped off
    """feet""": """ft""",
    """foot""": """ft""",
    """yard""": """yd""",
    """mile""": """mi""",
}

snake_case_     			=						{
    """mm""": from_to(0.0_01, 10_00),
    """cm""": from_to(0.01, 1_00),
    """m""": from_to(1, 1),
    """km""": from_to(10_00, 0.0_01),
    """in""": from_to(0.02_54, 39.37_01),
    """ft""": from_to(0.30_48, 3.2_80_84),
    """yd""": from_to(0.91_44, 1.0_93_61),
    """mi""": from_to(16_09.34, 0.0_00_62_13_71),
}
def 				_lowerCamelCase(	UpperCamelCase__     :			float     ,							UpperCamelCase__     :			str     ,							UpperCamelCase__     :			str		)		->	float:
    A							:							Optional[int]				=    from_type.lower().rstrip('''s'''		)
    A							:							str				=    TYPE_CONVERSION.get(UpperCamelCase__     ,							UpperCamelCase__		)
    A							:							List[Any]				=    to_type.lower().rstrip('''s'''		)
    A							:							Optional[int]				=    TYPE_CONVERSION.get(UpperCamelCase__     ,							UpperCamelCase__		)
    if new_from not in METRIC_CONVERSION:
        A							:							Optional[Any]				=    (
            F'''Invalid \'from_type\' value: {from_type!r}.\n'''
            F'''Conversion abbreviations are: {', '.join(UpperCamelCase__		)}'''
        )
        raise ValueError(UpperCamelCase__		)
    if new_to not in METRIC_CONVERSION:
        A							:							Optional[Any]				=    (
            F'''Invalid \'to_type\' value: {to_type!r}.\n'''
            F'''Conversion abbreviations are: {', '.join(UpperCamelCase__		)}'''
        )
        raise ValueError(UpperCamelCase__		)
    return value * METRIC_CONVERSION[new_from].from_ * METRIC_CONVERSION[new_to].to


if __name__ == "__main__":
     import doctest

     doctest.testmod()







'''simple docstring'''






def 				_lowerCamelCase(	UpperCamelCase__     :			int = 1_000		)		->	int:
    A							:							Optional[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)
    A							:							Tuple				=    [0, 0, 6, 6, 5, 5, 5, 7, 6, 6]

    A							:							str				=    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())))
