

'''simple docstring'''

import os




def 							_UpperCamelCase				(   lowerCAmelCase__:					str = "matrix.txt"   )      -> int:
							with open(os.path.join(os.path.dirname(lowerCAmelCase__   )		,lowerCAmelCase__   )   ) as in_file:
														SCREAMING_SNAKE_CASE_				=				in_file.read()

							SCREAMING_SNAKE_CASE_				=				[[int(lowerCAmelCase__   ) for cell in row.split(','   )] for row in data.strip().splitlines()]
							SCREAMING_SNAKE_CASE_				=				[[0 for cell in row] for row in grid]
							SCREAMING_SNAKE_CASE_				=				len(grid[0]   )

							SCREAMING_SNAKE_CASE_				=				[[0 for i in range(lowerCAmelCase__   )] for j in range(lowerCAmelCase__   )]
							SCREAMING_SNAKE_CASE_				=				grid[0][0]
							for i in range(1		,lowerCAmelCase__   ):
														SCREAMING_SNAKE_CASE_				=				grid[0][i] + dp[0][i - 1]
							for i in range(1		,lowerCAmelCase__   ):
														SCREAMING_SNAKE_CASE_				=				grid[i][0] + dp[i - 1][0]

							for i in range(1		,lowerCAmelCase__   ):
														for j in range(1		,lowerCAmelCase__   ):
																					SCREAMING_SNAKE_CASE_				=				grid[i][j] + min(dp[i - 1][j]		,dp[i][j - 1]   )

							return dp[-1][-1]


if __name__ == "__main__":
							print(f"{solution() = }")








'''simple docstring'''

import os

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




def 							_UpperCamelCase				(   )      -> List[Any]:
							SCREAMING_SNAKE_CASE_				=				os.path.dirname(os.path.realpath(lowerCAmelCase__   )   )
							SCREAMING_SNAKE_CASE_				=				os.path.join(lowerCAmelCase__		,'words.txt'   )

							SCREAMING_SNAKE_CASE_				=				''
							with open(lowerCAmelCase__   ) as f:
														SCREAMING_SNAKE_CASE_				=				f.readline()

							SCREAMING_SNAKE_CASE_				=				[word.strip('"'   ) for word in words.strip('\r\n'   ).split(','   )]
							SCREAMING_SNAKE_CASE_				=				[
							    word
							    for word in [sum(ord(lowerCAmelCase__   ) - 64 for x in word   ) for word in words]
							    if word in TRIANGULAR_NUMBERS
							]
							return len(lowerCAmelCase__   )


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





