

import os

def        lowerCamelCase__       (    _a = "input.txt"):

	with open(os.path.join(os.path.dirname(_a)							,	_a)) as input_file:
		SCREAMING_SNAKE_CASE      :					Dict    =				[
		    [int(_a) for element in line.split(",")]
		    for line in input_file.readlines()
		]

	SCREAMING_SNAKE_CASE      :					Tuple    =				len(_a)
	SCREAMING_SNAKE_CASE      :					Union[str, Any]    =				len(matrix[0])

	SCREAMING_SNAKE_CASE      :					Optional[int]    =				[[-1 for _ in range(_a)] for _ in range(_a)]
	for i in range(_a):
		SCREAMING_SNAKE_CASE      :					Any    =				matrix[i][0]

	for j in range(1							,	_a):
		for i in range(_a):
			SCREAMING_SNAKE_CASE      :					Optional[int]    =				minimal_path_sums[i][j - 1] + matrix[i][j]

		for i in range(1							,	_a):
			SCREAMING_SNAKE_CASE      :					Tuple    =				min(
			    minimal_path_sums[i][j]							,	minimal_path_sums[i - 1][j] + matrix[i][j])

		for i in range(rows - 2							,	-1							,	-1):
			SCREAMING_SNAKE_CASE      :					List[Any]    =				min(
			    minimal_path_sums[i][j]							,	minimal_path_sums[i + 1][j] + matrix[i][j])

	return min(minimal_path_sums_row[-1] for minimal_path_sums_row in minimal_path_sums)


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




'''simple docstring'''




from __future__ import annotations

import math



def 	a			( lowerCamelCase__    ):
			'''simple docstring'''





			if num <= 0:
						A_	:						List[Any]	=     f'{num}: Invalid input, please enter a positive integer.'
						raise ValueError(lowerCamelCase__    )

			A_	:						Dict	=     [True] * (num + 1)
			A_	:						List[Any]	=     []
			A_	:						Tuple	=     2
			A_	:						Optional[int]	=     int(math.sqrt(lowerCamelCase__    )    )

			while start <= end:
						# If start is a prime
						if sieve[start] is True:
									prime.append(lowerCamelCase__    )

									# Set multiples of start be False
									for i in range(start * start						,      num + 1						,      lowerCamelCase__    ):
												if sieve[i] is True:
															A_	:						List[Any]	=     False

						start += 1

			for j in range(end + 1						,      num + 1    ):
						if sieve[j] is True:
									prime.append(lowerCamelCase__    )

			return prime


if __name__ == "__main__":
						print(prime_sieve(int(input('''Enter a positive integer: ''').strip())))