



def 				A				(					_lowerCamelCase = 50_000_000  ):





							'''simple docstring'''




							_lowerCAmelCase     :							Optional[Any]    =    set()
							_lowerCAmelCase     :							Any    =    int((limit - 24) ** (1 / 2)  )

							_lowerCAmelCase     :							Tuple    =    set(range(3				, prime_square_limit + 1				, 2  )  )
							primes.add(2  )
							for p in range(3				, prime_square_limit + 1				, 2  ):
														if p not in primes:
																					continue
														primes.difference_update(set(range(p * p				, prime_square_limit + 1				, _lowerCamelCase  )  )  )

							for primea in primes:
														_lowerCAmelCase     :							Dict    =    primea * primea
														for primea in primes:
																					_lowerCAmelCase     :							Any    =    primea * primea * primea
																					if square + cube >= limit - 16:
																												break
																					for primea in primes:
																												_lowerCAmelCase     :							Optional[int]    =    primea * primea * primea * primea
																												_lowerCAmelCase     :							Union[str, Any]    =    square + cube + tetr
																												if total >= limit:
																																			break
																												ret.add(_lowerCamelCase  )

							return len(_lowerCamelCase  )


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





from PIL import Image






def 				A				(					_lowerCamelCase  ):





							'''simple docstring'''




							_lowerCAmelCase   ,    _lowerCAmelCase     :							int    =    image.size
							_lowerCAmelCase     :							Any    =    0
							_lowerCAmelCase     :							Tuple    =    image.load()
							for i in range(_lowerCamelCase  ):
														for j in range(_lowerCamelCase  ):
																					_lowerCAmelCase     :							Union[str, Any]    =    pixels[j, i]
																					mean += pixel
							mean //= width * height

							for j in range(_lowerCamelCase  ):
														for i in range(_lowerCamelCase  ):
																					_lowerCAmelCase     :							Optional[Any]    =    255 if pixels[i, j] > mean else 0
							return image


if __name__ == "__main__":
						_snake_case		=  mean_threshold(Image.open("path_to_image").convert("L"))
						image.save("output_image_path")
