
'''simple docstring'''

def 		_UpperCAmelCase			(					_lowerCamelCase  :    List[str] = 10_00						)      ->  Dict:
  _lowerCAmelCase    :					Optional[int]							=   [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    :					Tuple							=   [0, 0, 6, 6, 5, 5, 5, 7, 6, 6]

  _lowerCAmelCase    :					Any							=   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())))



'''simple docstring'''

from __future__ import annotations


class 					a_					:




       def __init__(       self				,				snake_case_ = 0					):
         _lowerCAmelCase    :					Optional[Any]							=   value
         _lowerCAmelCase    :					Node | None							=   None
         _lowerCAmelCase    :					Node | None							=   None



def 		_UpperCAmelCase			(					_lowerCamelCase  :    Node | None					, _lowerCamelCase  :    Node | None						)      ->  Node | None:
  if treea is None:
    return treea
  if treea is None:
    return treea

  _lowerCAmelCase    :					Any							=   treea.value + treea.value
  _lowerCAmelCase    :					Tuple							=   merge_two_binary_trees(treea.left					, treea.left						)
  _lowerCAmelCase    :					List[str]							=   merge_two_binary_trees(treea.right					, treea.right						)
  return treea


def 		_UpperCAmelCase			(					_lowerCamelCase  :    Node | None						)      ->  None:
  if root:
    print(root.value						)
    print_preorder(root.left						)
    print_preorder(root.right						)


if __name__ == "__main__":
     UpperCamelCase_            =    Node(1)
     UpperCamelCase_            =    Node(2)
     UpperCamelCase_            =    Node(3)
     UpperCamelCase_            =    Node(4)

     UpperCamelCase_            =    Node(2)
     UpperCamelCase_            =    Node(4)
     UpperCamelCase_            =    Node(6)
     UpperCamelCase_            =    Node(9)
     UpperCamelCase_            =    Node(5)

     print("""Tree1 is: """)
     print_preorder(treea)
     print("""Tree2 is: """)
     print_preorder(treea)
     UpperCamelCase_            =    merge_two_binary_trees(treea, treea)
     print("""Merged Tree is: """)
     print_preorder(merged_tree)


