





# A Bipartite Graph is a graph whose vertices can be divided into two independent sets,
# U and V such that every edge (u, v) either connects a vertex from U to V or a vertex
# from V to U. In other words, for every edge (u, v), either u belongs to U and v to V,
# or u belongs to V and v to U. We can also say that there is no edge that connects
# vertices of same set.
from queue import Queue

def     UpperCAmelCase_						(						_UpperCAmelCase       :Optional[Any]							)  ->							List[str]:
     '''simple docstring'''


     A_					      =  Queue()
     A_					      =  [False] * len(_UpperCAmelCase							)
     A_					      =  [-1] * len(_UpperCAmelCase							)

     def bfs():
          while not queue.empty():
               A_					      =  queue.get()
               A_					      =  True

               for neighbour in graph[u]:
                    if neighbour == u:
                         return False

                    if color[neighbour] == -1:
                         A_					      =  1 - color[u]
                         queue.put(_UpperCAmelCase							)

                    elif color[neighbour] == color[u]:
                         return False

          return True

     for i in range(len(_UpperCAmelCase							)							):
          if not visited[i]:
               queue.put(_UpperCAmelCase							)
               A_					      =  0
               if bfs() is False:
                    return False

     return True


if __name__ == "__main__":
      # Adjacency List of graph
      print(check_bipartite({0: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2]}))










def     UpperCAmelCase_						(						_UpperCAmelCase       :int = 1000							)  ->							int:
     '''simple docstring'''


     A_					      =					[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_					      =					[0, 0, 6, 6, 5, 5, 5, 7, 6, 6]

     A_					      =					0

     for i in range(1     ,	n + 1							):
          if i < 1000:
               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 // 1000] + 8
     return count


if __name__ == "__main__":
      print(solution(int(input().strip())))



