def    lowerCAmelCase_ (     __A							)     ->				bool:







      '''simple docstring'''


      UpperCAmelCase__								=  set()
      # To detect a back edge, keep track of vertices currently in the recursion stack
      UpperCAmelCase__								=  set()
      return any(
          node not in visited and depth_first_search(__A,  __A,  __A,  __A							)
          for node in graph							)




def    lowerCAmelCase_ (     __A,  __A,  __A,  __A							)     ->				bool:







      '''simple docstring'''


      visited.add(__A							)
      rec_stk.add(__A							)

      for node in graph[vertex]:
            if node not in visited:
                  if depth_first_search(__A,  __A,  __A,  __A							):
                        return True
            elif node in rec_stk:
                  return True

    # The node needs to be removed from recursion stack before function ends
      rec_stk.remove(__A							)
      return False


if __name__ == "__main__":
      from doctest import testmod

      testmod()










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