

def  __lowerCAmelCase (  A = 1000      ):
	UpperCAmelCase_    			=     0
	UpperCAmelCase_    			=     0
	while 1:
		num += 3
		if num >= n:
			break
		total += num
		num += 2
		if num >= n:
			break
		total += num
		num += 1
		if num >= n:
			break
		total += num
		num += 3
		if num >= n:
			break
		total += num
		num += 1
		if num >= n:
			break
		total += num
		num += 2
		if num >= n:
			break
		total += num
		num += 3
		if num >= n:
			break
		total += num
	return total


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


from cva import COLOR_BGR2GRAY, cvtColor, imread, imshow, waitKey
from numpy import divide, inta, multiply, ravel, sort, zeros_like



def  __lowerCAmelCase (  A    ,       A=3      ):
	UpperCAmelCase_    			=     int(mask / 2      )
	# copy image size
	UpperCAmelCase_    			=     zeros_like(A      )
	for i in range(A    ,       gray_img.shape[0] - bd      ):
		for j in range(A    ,       gray_img.shape[1] - bd      ):
			# get mask according with mask
			UpperCAmelCase_    			=     ravel(gray_img[i - bd : i + bd + 1, j - bd : j + bd + 1]      )
			# calculate mask median
			UpperCAmelCase_    			=     sort(A      )[inta(divide((multiply(A    ,       A      ))    ,       2      ) + 1      )]
			UpperCAmelCase_    			=     median
	return median_img


if __name__ == "__main__":
				# read original image
				_a:      Optional[int]								=     imread("""../image_data/lena.jpg""")
				# turn image in gray scale value
				_a:      Dict								=     cvtColor(img, COLOR_BGR2GRAY)

				# get values with two different mask size
				_a:      Tuple								=     median_filter(gray, 3)
				_a:      Dict								=     median_filter(gray, 5)

				# show result images
				imshow("""median filter with 3x3 mask""", medianaxa)
				imshow("""median filter with 5x5 mask""", medianaxa)
				waitKey(0)