
import numpy as np
from PIL import Image


def 		_UpperCAmelCase			(					_lowerCamelCase  :    np.array						)      ->  np.array:
  _lowerCAmelCase    :					List[str]							=   rgb[:, :, 0], rgb[:, :, 1], rgb[:, :, 2]
  return 0.2989 * r + 0.5870 * g + 0.1140 * b


def 		_UpperCAmelCase			(					_lowerCamelCase  :    np.array						)      ->  np.array:
  return (gray > 1_27) & (gray <= 2_55)


def 		_UpperCAmelCase			(					_lowerCamelCase  :    np.array					, _lowerCamelCase  :    np.array						)      ->  np.array:
  _lowerCAmelCase    :					List[Any]							=   np.zeros_like(_lowerCamelCase						)
  _lowerCAmelCase    :					Dict							=   np.zeros(
      (image.shape[0] + kernel.shape[0] - 1, image.shape[1] + kernel.shape[1] - 1)						)

  # Copy image to padded image
  _lowerCAmelCase    :					Dict							=   image

  # Iterate over image & apply kernel
  for x in range(image.shape[1]						):
    for y in range(image.shape[0]						):
      _lowerCAmelCase    :					Optional[Any]							=   (
          kernel * image_padded[y : y + kernel.shape[0], x : x + kernel.shape[1]]
      ).sum()
      _lowerCAmelCase    :					Union[str, Any]							=   int(summation == 5						)
  return output


# kernel to be applied
UpperCamelCase_            =    np.array([[0, 1, 0], [1, 1, 1], [0, 1, 0]])

if __name__ == "__main__":
     # read original image
     UpperCamelCase_            =    np.array(Image.open(r"""..\image_data\lena.jpg"""))
     # Apply erosion operation to a binary image
     UpperCamelCase_            =    erosion(grayabinary(rgbagray(image)), structuring_element)
     # Save the output image
     UpperCamelCase_            =    Image.fromarray(output).convert("""RGB""")
     pil_img.save("""result_erosion.png""")




'''simple docstring'''

def 		_UpperCAmelCase			(					_lowerCamelCase  :    int = 1_00						)      ->  int:
  _lowerCAmelCase    :					Dict							=   [[0 for _ in range(_lowerCamelCase						)] for _ in range(m + 1						)]
  for i in range(m + 1						):
    _lowerCAmelCase    :					List[str]							=   1

  for n in range(m + 1						):
    for k in range(1					, _lowerCamelCase						):
      memo[n][k] += memo[n][k - 1]
      if n > k:
        memo[n][k] += memo[n - k - 1][k]

  return memo[m][m - 1] - 1


if __name__ == "__main__":
     print(solution(int(input("""Enter a number: """).strip())))


