

def  snake_case_(_UpperCamelCase	)				->      int:



  """simple docstring"""






  if number != int(_UpperCamelCase	):
    raise ValueError('''factorial() only accepts integral values'''	)
  if number < 0:
    raise ValueError('''factorial() not defined for negative values'''	)
  _snake_case		=				1
  for i in range(1					,			number + 1	):
    value *= i
  return value



def  snake_case_(_UpperCamelCase	)				->      int:



  """simple docstring"""






  if not isinstance(_UpperCamelCase					,			_UpperCamelCase	):
    raise ValueError('''factorial() only accepts integral values'''	)
  if n < 0:
    raise ValueError('''factorial() not defined for negative values'''	)
  return 1 if n == 0 or n == 1 else n * factorial(n - 1	)


if __name__ == "__main__":
 import doctest

 doctest.testmod()

 __A     						=      int(input('''Enter a positive integer: ''').strip() or 0)
 print(f'''factorial{n} is {factorial(n)}''')




from __future__ import annotations

from collections import Counter



def  snake_case_(_UpperCamelCase	)				->      list[int]:



  """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					,			_UpperCamelCase					,			2	):
    if is_prime[i]:
      primes.append(_UpperCamelCase	)

  return primes



def  snake_case_(_UpperCamelCase	)				->      list[list[int]]:



  """simple docstring"""






  _snake_case		=				str(_UpperCamelCase	)
  _snake_case		=				[]
  _snake_case		=				['''0''', '''1''', '''2''', '''3''', '''4''', '''5''', '''6''', '''7''', '''8''', '''9''']

  for duplicate in Counter(_UpperCamelCase	) - Counter(set(_UpperCamelCase	)	):
    _snake_case		=				[int(number_str.replace(_UpperCamelCase					,			_UpperCamelCase	)	) for digit in digits]
    replacements.append(_UpperCamelCase	)

  return replacements



def  snake_case_(_UpperCamelCase = 8	)				->      int:



  """simple docstring"""






  _snake_case		=				set()

  # Filter primes with less than 3 replaceable digits
  _snake_case		=				{
      x for x in set(prime_sieve(1_000_000	)	) if len(str(_UpperCamelCase	)	) - len(set(str(_UpperCamelCase	)	)	) >= 3
  }

  for prime in primes:
    if prime in numbers_checked:
      continue

    _snake_case		=				digit_replacements(_UpperCamelCase	)

    for family in replacements:
      numbers_checked.update(_UpperCamelCase	)
      _snake_case		=				primes.intersection(_UpperCamelCase	)

      if len(_UpperCamelCase	) != family_length:
        continue

      return min(_UpperCamelCase	)

  return -1


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

