

class 				A_					:


     def __init__(				self     :						str   )				->      Tuple:
      __lowerCAmelCase:  Dict        = [0]
      __lowerCAmelCase:  List[Any]        = 0


     def     UpperCAmelCase    (				self     :						int     ,    UpperCAmelCase     :						int   )				->      None:
      __lowerCAmelCase:  Union[str, Any]        = self.__heap[i]
      while i // 2 > 0:
       if self.__heap[i] > self.__heap[i // 2]:
        __lowerCAmelCase:  Optional[Any]        = self.__heap[i // 2]
        __lowerCAmelCase:  List[Any]        = temporary
       i //= 2


     def     UpperCAmelCase    (				self     :						str     ,    UpperCAmelCase     :						int   )				->      None:
      self.__heap.append(UpperCAmelCase   )
      self.__size += 1
      self.__swap_up(self.__size   )


     def     UpperCAmelCase    (				self     :						List[str]     ,    UpperCAmelCase     :						int   )				->      None:
      while self.__size >= 2 * i:
       if 2 * i + 1 > self.__size:
        __lowerCAmelCase:  Tuple        = 2 * i
       else:
        if self.__heap[2 * i] > self.__heap[2 * i + 1]:
         __lowerCAmelCase:  List[Any]        = 2 * i
        else:
         __lowerCAmelCase:  List[str]        = 2 * i + 1
       __lowerCAmelCase:  str        = self.__heap[i]
       if self.__heap[i] < self.__heap[bigger_child]:
        __lowerCAmelCase:  int        = self.__heap[bigger_child]
        __lowerCAmelCase:  List[Any]        = temporary
       __lowerCAmelCase:  Optional[int]        = bigger_child


     def     UpperCAmelCase    (				self     :						Dict   )				->      int:
      __lowerCAmelCase:  List[Any]        = self.__heap[1]
      __lowerCAmelCase:  Any        = self.__heap[self.__size]
      self.__size -= 1
      self.__heap.pop()
      self.__swap_down(1   )
      return max_value


     @property
     def     UpperCAmelCase    (				self     :						Tuple   )				->      Optional[Any]:
      return self.__heap[1:]


     def __len__(				self     :						int   )				->      int:
      return self.__size


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  # create an instance of BinaryHeap
  _a									=  BinaryHeap()
  binary_heap.insert(6)
  binary_heap.insert(1_0)
  binary_heap.insert(1_5)
  binary_heap.insert(1_2)
  # pop root(max-values because it is max heap)
  print(binary_heap.pop())  # 15
  print(binary_heap.pop())  # 12
  # get the list and size after operations
  print(binary_heap.get_list)
  print(len(binary_heap))








def _a					(			SCREAMING_SNAKE_CASE						:     int = 10_00						)       ->       int:

 """simple docstring"""






 __lowerCAmelCase:  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)
 __lowerCAmelCase:  List[Any]        = [0, 0, 6, 6, 5, 5, 5, 7, 6, 6]

 __lowerCAmelCase:  Dict        = 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())))





