

import math as m







def _a					(			SCREAMING_SNAKE_CASE						:     List[str]       ,   SCREAMING_SNAKE_CASE						:     List[Any]       ,   SCREAMING_SNAKE_CASE						:     int=0.0_0_1						)       ->       str:

 """simple docstring"""






 return (f(a + h						) - f(a - h						)) / (2 * h)







def _a					(			SCREAMING_SNAKE_CASE						:     Tuple       ,   SCREAMING_SNAKE_CASE						:     Optional[Any]=0       ,   SCREAMING_SNAKE_CASE						:     str=1_00       ,   SCREAMING_SNAKE_CASE						:     Dict=0.0_0_0_1       ,   SCREAMING_SNAKE_CASE						:     str=1E-6       ,   SCREAMING_SNAKE_CASE						:     Dict=False						)       ->       Tuple:

 """simple docstring"""






 __lowerCAmelCase:  Optional[int]        = xa  # set the initial guess
 __lowerCAmelCase:  List[Any]        = [a]
 __lowerCAmelCase:  Any        = abs(f(SCREAMING_SNAKE_CASE						)						)
 __lowerCAmelCase:  Dict        = lambda SCREAMING_SNAKE_CASE						: calc_derivative(SCREAMING_SNAKE_CASE       ,   SCREAMING_SNAKE_CASE       ,   h=SCREAMING_SNAKE_CASE						)  # noqa: E731  Derivative of f(x)
 for _ in range(SCREAMING_SNAKE_CASE						):
  if fa(SCREAMING_SNAKE_CASE						) == 0:
   raise ValueError('No converging solution found'						)
  __lowerCAmelCase:  Optional[int]        = a - f(SCREAMING_SNAKE_CASE						) / fa(SCREAMING_SNAKE_CASE						)  # Calculate the next estimate
  if logsteps:
   steps.append(SCREAMING_SNAKE_CASE						)
  if error < maxerror:
   break
 else:
  raise ValueError('Iteration limit reached, no converging solution found'						)
 if logsteps:
  # If logstep is true, then log intermediate steps
  return a, error, steps
 return a, error


if __name__ == "__main__":
  from matplotlib import pyplot as plt

  _a									=  lambda x: m.tanh(x) ** 2 - m.exp(3 * x)  # noqa: E731
  _a			,      _a			,      _a									=  newton_raphson(
      f, xa=1_0, maxiter=1_0_0_0, step=1E-6, logsteps=True
  )
  plt.plot([abs(f(x)) for x in steps])
  plt.xlabel('''step''')
  plt.ylabel('''error''')
  plt.show()
  print(f"solution = {{{solution:f}}}, error = {{{error:f}}}")








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





