


'''simple docstring'''
import math
from collections.abc import Iterator
from itertools import takewhile


def      a (     __a  )    ->      bool:



					'''simple docstring'''






					if 1 < number < 4:
										# 2 and 3 are primes
										return True
					elif number < 2 or number % 2 == 0 or number % 3 == 0:
										# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
										return False

					# All primes number are in format of 6k +/- 1
					for i in range(5					,   int(math.sqrt(__a  ) + 1  )					,   6  ):
										if number % i == 0 or number % (i + 2) == 0:
															return False
					return True


def      a (     )    ->      Iterator[int]:



					'''simple docstring'''






					UpperCamelCase__  :Optional[int]				   =					2
					while True:
										if is_prime(__a  ):
															yield num
										num += 1


def      a (     __a = 2000000  )    ->      int:



					'''simple docstring'''






					return sum(takewhile(lambda __a  : x < n					,   prime_generator()  )  )


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



'''simple docstring'''
from __future__ import annotations

import math
import random
from collections.abc import Collection
from typing import overload
class   lowercase      :

		"""simple docstring"""

		def __init__(						self       ,  UpperCamelCase_ = None				):

							'''simple docstring'''


							if components is None:
												UpperCamelCase__  :List[Any]				   =					[]
							UpperCamelCase__  :Optional[Any]				   =					list(UpperCamelCase_				)




		def __len__(						self				):

							'''simple docstring'''


							return len(self.__components				)




		def __str__(						self				):

							'''simple docstring'''


							return "(" + ",".join(map(UpperCamelCase_       ,  self.__components				)				) + ")"




		def __add__(						self       ,  UpperCamelCase_				):

							'''simple docstring'''


							UpperCamelCase__  :Any				   =					len(self				)
							if size == len(UpperCamelCase_				):
												UpperCamelCase__  :Dict				   =					[self.__components[i] + other.component(UpperCamelCase_				) for i in range(UpperCamelCase_				)]
												return Vector(UpperCamelCase_				)
							else:
												raise Exception('''must have the same size'''				)




		def __sub__(						self       ,  UpperCamelCase_				):

							'''simple docstring'''


							UpperCamelCase__  :Optional[Any]				   =					len(self				)
							if size == len(UpperCamelCase_				):
												UpperCamelCase__  :List[str]				   =					[self.__components[i] - other.component(UpperCamelCase_				) for i in range(UpperCamelCase_				)]
												return Vector(UpperCamelCase_				)
							else:  # error case
												raise Exception('''must have the same size'''				)




		@overload
		def __mul__(						self       ,  UpperCamelCase_				):

							'''simple docstring'''


							...




		@overload
		def __mul__(						self       ,  UpperCamelCase_				):

							'''simple docstring'''


							...




		def __mul__(						self       ,  UpperCamelCase_				):

							'''simple docstring'''


							if isinstance(UpperCamelCase_       ,  (float, int)				):
												UpperCamelCase__  :Optional[Any]				   =					[c * other for c in self.__components]
												return Vector(UpperCamelCase_				)
							elif isinstance(UpperCamelCase_       ,  UpperCamelCase_				) and len(self				) == len(UpperCamelCase_				):
												UpperCamelCase__  :Optional[int]				   =					len(self				)
												UpperCamelCase__  :List[Any]				   =					[self.__components[i] * other.component(UpperCamelCase_				) for i in range(UpperCamelCase_				)]
												return sum(UpperCamelCase_				)
							else:  # error case
												raise Exception('''invalid operand!'''				)




		def        lowerCAmelCase__							(						self				):

							'''simple docstring'''


							return Vector(self.__components				)




		def        lowerCAmelCase__							(						self       ,  UpperCamelCase_				):

							'''simple docstring'''


							if isinstance(UpperCamelCase_       ,  UpperCamelCase_				) and -len(self.__components				) <= i < len(self.__components				):
												return self.__components[i]
							else:
												raise Exception('''index out of range'''				)




		def        lowerCAmelCase__							(						self       ,  UpperCamelCase_       ,  UpperCamelCase_				):

							'''simple docstring'''


							assert -len(self.__components				) <= pos < len(self.__components				)
							UpperCamelCase__  :Optional[int]				   =					value




		def        lowerCAmelCase__							(						self				):

							'''simple docstring'''


							if len(self.__components				) == 0:
												raise Exception('''Vector is empty'''				)
							UpperCamelCase__  :List[str]				   =					[c**2 for c in self.__components]
							return math.sqrt(sum(UpperCamelCase_				)				)




		def        lowerCAmelCase__							(						self       ,  UpperCamelCase_       ,  UpperCamelCase_ = False				):

							'''simple docstring'''


							UpperCamelCase__  :List[Any]				   =					self * other
							UpperCamelCase__  :Optional[int]				   =					self.euclidean_length() * other.euclidean_length()
							if deg:
												return math.degrees(math.acos(num / den				)				)
							else:
												return math.acos(num / den				)



def      a (     __a  )    ->      Vector:



					'''simple docstring'''






					assert isinstance(__a					,   __a  )
					return Vector([0] * dimension  )


def      a (     __a					,   __a  )    ->      Vector:



					'''simple docstring'''






					assert isinstance(__a					,   __a  ) and (isinstance(__a					,   __a  ))
					UpperCamelCase__  :str				   =					[0] * dimension
					UpperCamelCase__  :Tuple				   =					1
					return Vector(__a  )


def      a (     __a					,   __a					,   __a  )    ->      Vector:



					'''simple docstring'''






					assert (
					    isinstance(__a					,   __a  )
					    and isinstance(__a					,   __a  )
					    and (isinstance(__a					,   (int, float)  ))
					)
					return x * scalar + y


def      a (     __a					,   __a					,   __a  )    ->      Vector:



					'''simple docstring'''






					random.seed(__a  )
					UpperCamelCase__  :Optional[Any]				   =					[random.randint(__a					,   __a  ) for _ in range(__a  )]
					return Vector(__a  )
class   lowercase      :

		"""simple docstring"""

		def __init__(						self       ,  UpperCamelCase_       ,  UpperCamelCase_       ,  UpperCamelCase_				):

							'''simple docstring'''


							UpperCamelCase__  :int				   =					matrix
							UpperCamelCase__  :Union[str, Any]				   =					w
							UpperCamelCase__  :Optional[int]				   =					h




		def __str__(						self				):

							'''simple docstring'''


							UpperCamelCase__  :Dict				   =					''''''
							for i in range(self.__height				):
												ans += "|"
												for j in range(self.__width				):
																	if j < self.__width - 1:
																						ans += str(self.__matrix[i][j]				) + ","
																	else:
																						ans += str(self.__matrix[i][j]				) + "|\n"
							return ans




		def __add__(						self       ,  UpperCamelCase_				):

							'''simple docstring'''


							if self.__width == other.width() and self.__height == other.height():
												UpperCamelCase__  :int				   =					[]
												for i in range(self.__height				):
																	UpperCamelCase__  :int				   =					[
																	    self.__matrix[i][j] + other.component(UpperCamelCase_       ,  UpperCamelCase_				)
																	    for j in range(self.__width				)
																	]
																	matrix.append(UpperCamelCase_				)
												return Matrix(UpperCamelCase_       ,  self.__width       ,  self.__height				)
							else:
												raise Exception('''matrix must have the same dimension!'''				)




		def __sub__(						self       ,  UpperCamelCase_				):

							'''simple docstring'''


							if self.__width == other.width() and self.__height == other.height():
												UpperCamelCase__  :Optional[Any]				   =					[]
												for i in range(self.__height				):
																	UpperCamelCase__  :Optional[int]				   =					[
																	    self.__matrix[i][j] - other.component(UpperCamelCase_       ,  UpperCamelCase_				)
																	    for j in range(self.__width				)
																	]
																	matrix.append(UpperCamelCase_				)
												return Matrix(UpperCamelCase_       ,  self.__width       ,  self.__height				)
							else:
												raise Exception('''matrices must have the same dimension!'''				)




		@overload
		def __mul__(						self       ,  UpperCamelCase_				):

							'''simple docstring'''


							...




		@overload
		def __mul__(						self       ,  UpperCamelCase_				):

							'''simple docstring'''


							...




		def __mul__(						self       ,  UpperCamelCase_				):

							'''simple docstring'''


							if isinstance(UpperCamelCase_       ,  UpperCamelCase_				):  # matrix-vector
												if len(UpperCamelCase_				) == self.__width:
																	UpperCamelCase__  :Any				   =					zero_vector(self.__height				)
																	for i in range(self.__height				):
																						UpperCamelCase__  :Any				   =					[
																						    self.__matrix[i][j] * other.component(UpperCamelCase_				)
																						    for j in range(self.__width				)
																						]
																						ans.change_component(UpperCamelCase_       ,  sum(UpperCamelCase_				)				)
																	return ans
												else:
																	raise Exception(
																	    '''vector must have the same size as the '''
																	    '''number of columns of the matrix!'''				)
							elif isinstance(UpperCamelCase_       ,  (int, float)				):  # matrix-scalar
												UpperCamelCase__  :Union[str, Any]				   =					[
												    [self.__matrix[i][j] * other for j in range(self.__width				)]
												    for i in range(self.__height				)
												]
												return Matrix(UpperCamelCase_       ,  self.__width       ,  self.__height				)
							return None




		def        lowerCAmelCase__							(						self				):

							'''simple docstring'''


							return self.__height




		def        lowerCAmelCase__							(						self				):

							'''simple docstring'''


							return self.__width




		def        lowerCAmelCase__							(						self       ,  UpperCamelCase_       ,  UpperCamelCase_				):

							'''simple docstring'''


							if 0 <= x < self.__height and 0 <= y < self.__width:
												return self.__matrix[x][y]
							else:
												raise Exception('''change_component: indices out of bounds'''				)




		def        lowerCAmelCase__							(						self       ,  UpperCamelCase_       ,  UpperCamelCase_       ,  UpperCamelCase_				):

							'''simple docstring'''


							if 0 <= x < self.__height and 0 <= y < self.__width:
												UpperCamelCase__  :Tuple				   =					value
							else:
												raise Exception('''change_component: indices out of bounds'''				)




		def        lowerCAmelCase__							(						self       ,  UpperCamelCase_       ,  UpperCamelCase_				):

							'''simple docstring'''


							if self.__height != self.__width:
												raise Exception('''Matrix is not square'''				)
							UpperCamelCase__  :str				   =					self.__matrix[:x] + self.__matrix[x + 1 :]
							for i in range(len(UpperCamelCase_				)				):
												UpperCamelCase__  :Union[str, Any]				   =					minor[i][:y] + minor[i][y + 1 :]
							return Matrix(UpperCamelCase_       ,  self.__width - 1       ,  self.__height - 1				).determinant()




		def        lowerCAmelCase__							(						self       ,  UpperCamelCase_       ,  UpperCamelCase_				):

							'''simple docstring'''


							if self.__height != self.__width:
												raise Exception('''Matrix is not square'''				)
							if 0 <= x < self.__height and 0 <= y < self.__width:
												return (-1) ** (x + y) * self.minor(UpperCamelCase_       ,  UpperCamelCase_				)
							else:
												raise Exception('''Indices out of bounds'''				)




		def        lowerCAmelCase__							(						self				):

							'''simple docstring'''


							if self.__height != self.__width:
												raise Exception('''Matrix is not square'''				)
							if self.__height < 1:
												raise Exception('''Matrix has no element'''				)
							elif self.__height == 1:
												return self.__matrix[0][0]
							elif self.__height == 2:
												return (
												    self.__matrix[0][0] * self.__matrix[1][1]
												    - self.__matrix[0][1] * self.__matrix[1][0]
												)
							else:
												UpperCamelCase__  :Optional[Any]				   =					[
												    self.__matrix[0][y] * self.cofactor(0       ,  UpperCamelCase_				) for y in range(self.__width				)
												]
												return sum(UpperCamelCase_				)



def      a (     __a  )    ->      Matrix:



					'''simple docstring'''






					UpperCamelCase__  :list[list[float]]				   =					[[0] * n for _ in range(__a  )]
					return Matrix(__a					,   __a					,   __a  )







def      a (     __a					,   __a					,   __a					,   __a  )    ->      Matrix:



					'''simple docstring'''






					random.seed(__a  )
					UpperCamelCase__  :list[list[float]]				   =					[
					    [random.randint(__a					,   __a  ) for _ in range(__a  )] for _ in range(__a  )
					]
					return Matrix(__a					,   __a					,   __a  )