
'''simple docstring'''




from collections.abc import Sequence
from queue import Queue





class  A				:





     def __init__(							self						,			SCREAMING_SNAKE_CASE						,			SCREAMING_SNAKE_CASE						,			SCREAMING_SNAKE_CASE						,			SCREAMING_SNAKE_CASE=None						,			SCREAMING_SNAKE_CASE=None	) ->				Dict:






         """simple docstring"""






         A       :   Dict					=						start
         A       :   Optional[Any]					=						end
         A       :   Any					=						val
         A       :   Union[str, Any]					=						(start + end) // 2
         A       :   List[str]					=						left
         A       :   Any					=						right





     def __repr__(							self	) ->				int:






         """simple docstring"""






         return F'SegmentTreeNode(start={self.start}, end={self.end}, val={self.val})'





class  A				:





     def __init__(							self						,			SCREAMING_SNAKE_CASE						,			SCREAMING_SNAKE_CASE	) ->				Any:






         """simple docstring"""






         A       :   Tuple					=						collection
         A       :   Any					=						function
         if self.collection:
             A       :   Dict					=						self._build_tree(0						,			len(snake_case_	) - 1	)





     def 				__lowerCAmelCase							(							self						,			SCREAMING_SNAKE_CASE						,			SCREAMING_SNAKE_CASE	) ->				Union[str, Any]:






         """simple docstring"""






         self._update_tree(self.root						,			snake_case_						,			snake_case_	)





     def 				__lowerCAmelCase							(							self						,			SCREAMING_SNAKE_CASE						,			SCREAMING_SNAKE_CASE	) ->				str:






         """simple docstring"""






         return self._query_range(self.root						,			snake_case_						,			snake_case_	)





     def 				__lowerCAmelCase							(							self						,			SCREAMING_SNAKE_CASE						,			SCREAMING_SNAKE_CASE	) ->				Optional[int]:






         """simple docstring"""






         if start == end:
             return SegmentTreeNode(snake_case_						,			snake_case_						,			self.collection[start]	)
         A       :   int					=						(start + end) // 2
         A       :   Dict					=						self._build_tree(snake_case_						,			snake_case_	)
         A       :   Any					=						self._build_tree(mid + 1						,			snake_case_	)
         return SegmentTreeNode(snake_case_						,			snake_case_						,			self.fn(left.val						,			right.val	)						,			snake_case_						,			snake_case_	)





     def 				__lowerCAmelCase							(							self						,			SCREAMING_SNAKE_CASE						,			SCREAMING_SNAKE_CASE						,			SCREAMING_SNAKE_CASE	) ->				Any:






         """simple docstring"""






         if node.start == i and node.end == i:
             A       :   List[Any]					=						val
             return
         if i <= node.mid:
             self._update_tree(node.left						,			snake_case_						,			snake_case_	)
         else:
             self._update_tree(node.right						,			snake_case_						,			snake_case_	)
         A       :   Optional[Any]					=						self.fn(node.left.val						,			node.right.val	)





     def 				__lowerCAmelCase							(							self						,			SCREAMING_SNAKE_CASE						,			SCREAMING_SNAKE_CASE						,			SCREAMING_SNAKE_CASE	) ->				List[str]:






         """simple docstring"""






         if node.start == i and node.end == j:
             return node.val

         if i <= node.mid:
             if j <= node.mid:
                 # range in left child tree
                 return self._query_range(node.left						,			snake_case_						,			snake_case_	)
             else:
                 # range in left child tree and right child tree
                 return self.fn(
                     self._query_range(node.left						,			snake_case_						,			node.mid	)						,			self._query_range(node.right						,			node.mid + 1						,			snake_case_	)						,			)
         else:
             # range in right child tree
             return self._query_range(node.right						,			snake_case_						,			snake_case_	)





     def 				__lowerCAmelCase							(							self	) ->				Union[str, Any]:






         """simple docstring"""






         if self.root is not None:
             A       :   Optional[int]					=						Queue()
             queue.put(self.root	)
             while not queue.empty():
                 A       :   Tuple					=						queue.get()
                 yield node

                 if node.left is not None:
                     queue.put(node.left	)

                 if node.right is not None:
                     queue.put(node.right	)


if __name__ == "__main__":
      import operator

      for fn in [operator.add, max, min]:
            print('*' * 50)
            lowercase			:				Dict    		=			SegmentTree([2, 1, 5, 3, 4], fn)
            for node in arr.traverse():
                  print(node)
            print()

            arr.update(1, 5)
            for node in arr.traverse():
                  print(node)
            print()

            print(arr.query_range(3, 4))  # 7
            print(arr.query_range(2, 2))  # 5
            print(arr.query_range(1, 3))  # 13
            print()











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