


from __future__ import annotations

from collections.abc import Callable
from typing import Any, Generic, TypeVar

UpperCAmelCase					:  Dict			=						TypeVar("T")







class     __lowercase    (				Generic[T]   ):



		"""simple docstring"""

		def __init__(      self						,	A						,	A     )   ->      None:







					'''simple docstring'''







					lowerCamelCase  						=   None

					lowerCamelCase  						=   len(_UpperCamelCase     )
					lowerCamelCase  						=   [any_type for _ in range(self.N     )] + arr
					lowerCamelCase  						=   fnc
					self.build()







		def  __A					(      self     )   ->      None:







					'''simple docstring'''







					for p in range(self.N - 1						,	0						,	-1     ):
								lowerCamelCase  						=   self.fn(self.st[p * 2]						,	self.st[p * 2 + 1]     )







		def  __A					(      self						,	A						,	A     )   ->      None:







					'''simple docstring'''







					p += self.N
					lowerCamelCase  						=   v
					while p > 1:
								lowerCamelCase  						=   p // 2
								lowerCamelCase  						=   self.fn(self.st[p * 2]						,	self.st[p * 2 + 1]     )







		def  __A					(      self						,	A						,	A     )   ->      T | None:  # noqa: E741







					'''simple docstring'''







					lowerCamelCase  						=   l + self.N, r + self.N

					lowerCamelCase  						=   None
					while l <= r:
								if l % 2 == 1:
											lowerCamelCase  						=   self.st[l] if res is None else self.fn(_UpperCamelCase						,	self.st[l]     )
								if r % 2 == 0:
											lowerCamelCase  						=   self.st[r] if res is None else self.fn(_UpperCamelCase						,	self.st[r]     )
								lowerCamelCase  						=   (l + 1) // 2, (r - 1) // 2
					return res


if __name__ == "__main__":
		from functools import reduce

		UpperCAmelCase					:  Tuple			=						[1, 10, -2, 9, -3, 8, 4, -7, 5, 6, 11, -12]

		UpperCAmelCase					:  Tuple			=						{
		    0: 7,
		    1: 2,
		    2: 6,
		    3: -14,
		    4: 5,
		    5: 4,
		    6: 7,
		    7: -10,
		    8: 9,
		    9: 10,
		    10: 12,
		    11: 1,
		}

		UpperCAmelCase					:  Optional[int]			=						SegmentTree(test_array, min)
		UpperCAmelCase					:  Tuple			=						SegmentTree(test_array, max)
		UpperCAmelCase					:  Optional[int]			=						SegmentTree(test_array, lambda a, b: a + b)






		def      __lowerCamelCase		(				):





					'''simple docstring'''




					for i in range(len(__snake_case	)	):
								for j in range(__snake_case   ,				len(__snake_case	)	):
											lowerCamelCase  						=   reduce(__snake_case   ,				test_array[i : j + 1]	)
											lowerCamelCase  						=   reduce(__snake_case   ,				test_array[i : j + 1]	)
											lowerCamelCase  						=   reduce(lambda lowerCamelCase__   ,				lowerCamelCase__	: a + b   ,				test_array[i : j + 1]	)
											assert min_range == min_segment_tree.query(__snake_case   ,				__snake_case	)
											assert max_range == max_segment_tree.query(__snake_case   ,				__snake_case	)
											assert sum_range == sum_segment_tree.query(__snake_case   ,				__snake_case	)

		test_all_segments()

		for index, value in test_updates.items():
				UpperCAmelCase					:  Optional[Any]			=						value
				min_segment_tree.update(index, value)
				max_segment_tree.update(index, value)
				sum_segment_tree.update(index, value)
				test_all_segments()









import os

# Precomputes a list of the 100 first triangular numbers
__UpperCAmelCase								=						[int(0.5 * n * (n + 1)) for n in range(1, 101)]




def      lowercase__      (     ):


					'''simple docstring'''


					UpperCAmelCase_    :      Any            =						os.path.dirname(os.path.realpath(__snake_case  )  )
					UpperCAmelCase_    :      Optional[Any]            =						os.path.join(__snake_case     ,       'words.txt'  )

					UpperCAmelCase_    :      Union[str, Any]            =						''
					with open(__snake_case  ) as f:
										UpperCAmelCase_    :      List[Any]            =						f.readline()

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


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






