"""simple docstring"""
import math





def 				lowerCAmelCase__      (     _UpperCamelCase    :			Tuple   )   ->			list:





						"""simple docstring"""






						snake_case        =     [True] * n
						snake_case        =     False
						snake_case        =     False
						snake_case        =     True

						for i in range(3	,     int(n**0.5 + 1   )	,     2   ):
												snake_case        =     i * 2
												while index < n:
																		snake_case        =     False
																		snake_case        =     index + i

						snake_case        =     [2]

						for i in range(3	,     SCREAMING_SNAKE_CASE_	,     2   ):
												if is_prime[i]:
																		primes.append(SCREAMING_SNAKE_CASE_   )

						return primes





def 				lowerCAmelCase__      (     _UpperCamelCase    :			List[Any] = 9_9_9_9_6_6_6_6_3_3_3_3   )   ->			int:





						"""simple docstring"""






						snake_case        =     math.floor(math.sqrt(SCREAMING_SNAKE_CASE_   )   ) + 1_0_0
						snake_case        =     prime_sieve(SCREAMING_SNAKE_CASE_   )

						snake_case        =     0
						snake_case        =     0
						snake_case        =     primes[prime_index]

						while (last_prime**2) <= limit:
												snake_case        =     primes[prime_index + 1]

												snake_case        =     last_prime**2
												snake_case        =     next_prime**2

												# Get numbers divisible by lps(current)
												snake_case        =     lower_bound + last_prime
												while upper_bound > current <= limit:
																		matches_sum += current
																		current += last_prime

												# Reset the upper_bound
												while (upper_bound - next_prime) > limit:
																		upper_bound -= next_prime

												# Add the numbers divisible by ups(current)
												snake_case        =     upper_bound - next_prime
												while current > lower_bound:
																		matches_sum += current
																		current -= next_prime

												# Remove the numbers divisible by both ups and lps
												snake_case        =     0
												while upper_bound > current <= limit:
																		if current <= lower_bound:
																								# Increment the current number
																								current += last_prime * next_prime
																								continue

																		if current > limit:
																								break

																		# Remove twice since it was added by both ups and lps
																		matches_sum -= current * 2

																		# Increment the current number
																		current += last_prime * next_prime

												# Setup for next pair
												snake_case        =     next_prime
												prime_index += 1

						return matches_sum


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



"""simple docstring"""
import os





def 				lowerCAmelCase__      (     _UpperCamelCase    :			str = "matrix.txt"   )   ->			int:





						"""simple docstring"""






						with open(os.path.join(os.path.dirname(_UpperCamelCase   )	,     _UpperCamelCase   )   ) as in_file:
												snake_case        =     in_file.read()

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

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

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

						return dp[-1][-1]


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


