





"""simple docstring"""




from collections import deque





def 						UpperCAmelCase__		(     _UpperCAmelCase					):






  """simple docstring"""





  A_  :       List[Any]										=  len(_UpperCAmelCase					)
  A_  :       Dict										=  deque()
  A_  :       Any										=  [False for _ in range(_UpperCAmelCase					)]
  A_  :       Optional[int]										=  [-1 for _ in range(_UpperCAmelCase					)]
  A_  :       Tuple										=  index_of[:]

  def strong_connect(_UpperCAmelCase ,					_UpperCAmelCase ,					_UpperCAmelCase					):
    A_  :       str										=  index  # the number when this node is seen
    A_  :       List[Any]										=  index  # lowest rank node reachable from here
    index += 1
    stack.append(_UpperCAmelCase					)
    A_  :       Optional[Any]										=  True

    for w in g[v]:
      if index_of[w] == -1:
        A_  :       int										=  strong_connect(_UpperCAmelCase ,					_UpperCAmelCase ,					_UpperCAmelCase					)
        A_  :       List[Any]										=  (
            lowlink_of[w] if lowlink_of[w] < lowlink_of[v] else lowlink_of[v]
        )
      elif on_stack[w]:
        A_  :       Tuple										=  (
            lowlink_of[w] if lowlink_of[w] < lowlink_of[v] else lowlink_of[v]
        )

    if lowlink_of[v] == index_of[v]:
      A_  :       Dict										=  []
      A_  :       int										=  stack.pop()
      A_  :       int										=  False
      component.append(_UpperCAmelCase					)
      while w != v:
        A_  :       Optional[int]										=  stack.pop()
        A_  :       int										=  False
        component.append(_UpperCAmelCase					)
      components.append(_UpperCAmelCase					)
    return index

  A_  :       Optional[Any]										=  []
  for v in range(_UpperCAmelCase					):
    if index_of[v] == -1:
      strong_connect(_UpperCAmelCase ,					0 ,					_UpperCAmelCase					)

  return components





def 						UpperCAmelCase__		(     _UpperCAmelCase ,					_UpperCAmelCase					):






  """simple docstring"""





  A_  :       str										=  [[] for _ in range(_UpperCAmelCase					)]
  for u, v in edges:
    g[u].append(_UpperCAmelCase					)
  return g


if __name__ == "__main__":
   # Test
   lowerCamelCase_     :						int						=					7
   lowerCamelCase_     :						Dict						=					[0, 0, 1, 2, 3, 3, 4, 4, 6]
   lowerCamelCase_     :						Any						=					[1, 3, 2, 0, 1, 4, 5, 6, 5]
   lowerCamelCase_     :						Optional[Any]						=					[(u, v) for u, v in zip(source, target)]
   lowerCamelCase_     :						Optional[int]						=					create_graph(n_vertices, edges)

   assert [[5], [6], [4], [3, 2, 1, 0]] == tarjan(g)






"""simple docstring"""




import os

# Precomputes a list of the 100 first triangular numbers
lowerCamelCase_     :						List[str]						=					[int(0.5 * n * (n + 1)) for n in range(1, 1_01)]





def 						UpperCAmelCase__		(     ):






  """simple docstring"""





  A_  :       Union[str, Any]										=  os.path.dirname(os.path.realpath(_UpperCAmelCase					)					)
  A_  :       Tuple										=  os.path.join(_UpperCAmelCase ,					'words.txt'					)

  A_  :       List[Any]										=  ''
  with open(_UpperCAmelCase					) as f:
    A_  :       int										=  f.readline()

  A_  :       Optional[Any]										=  [word.strip('"'					) for word in words.strip('\r\n'					).split(','					)]
  A_  :       Dict										=  [
      word
      for word in [sum(ord(_UpperCAmelCase					) - 64 for x in word					) for word in words]
      if word in TRIANGULAR_NUMBERS
  ]
  return len(_UpperCAmelCase					)


if __name__ == "__main__":
   print(solution())