



'''simple docstring'''







import math







def  SCREAMING_SNAKE_CASE__ (				SCREAMING_SNAKE_CASE     ):
		SCREAMING_SNAKE_CASE_						:Any										=      0
		if n % 2 == 0:
				count += 1
				while n % 2 == 0:
						SCREAMING_SNAKE_CASE_						:Any										=      int(n / 2     )
    # the n input value must be odd so that
    # we can skip one element (ie i += 2)

		SCREAMING_SNAKE_CASE_						:str										=      3

		while i <= int(math.sqrt(SCREAMING_SNAKE_CASE     )     ):
				if n % i == 0:
						count += 1
						while n % i == 0:
								SCREAMING_SNAKE_CASE_						:int										=      int(n / i     )
				SCREAMING_SNAKE_CASE_						:Any										=      i + 2

		# this condition checks the prime
		# number n is greater than 2

		if n > 2:
				count += 1
		return count


if __name__ == "__main__":
							SCREAMING_SNAKE_CASE__     : int				=   51_24_21_83
							print(f"""The number of distinct prime factors is/are {exact_prime_factor_count(n)}""")
							print(f"""The value of log(log(n)) is {math.log(math.log(n)):.4f}""")





'''simple docstring'''







def  SCREAMING_SNAKE_CASE__ (				SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE     ):
		assert b != 0, "This cannot accept modulo that is == 0"
		if n == 0:
				return 1

		if n % 2 == 1:
				return (bin_exp_mod(SCREAMING_SNAKE_CASE ,		n - 1 ,		SCREAMING_SNAKE_CASE     ) * a) % b

		SCREAMING_SNAKE_CASE_						:List[str]										=      bin_exp_mod(SCREAMING_SNAKE_CASE ,		n / 2 ,		SCREAMING_SNAKE_CASE     )
		return (r * r) % b


if __name__ == "__main__":
							try:
														SCREAMING_SNAKE_CASE__     : Any				=   int(input("""Enter Base : """).strip())
														SCREAMING_SNAKE_CASE__     : str				=   int(input("""Enter Power : """).strip())
														SCREAMING_SNAKE_CASE__     : List[Any]				=   int(input("""Enter Modulo : """).strip())
							except ValueError:
														print("""Invalid literal for integer""")

							print(bin_exp_mod(BASE, POWER, MODULO))
