

def 			__UpperCamelCase    (lowerCAmelCase					:  Optional[Any],    lowerCAmelCase					:  Optional[Any],    lowerCAmelCase					:  int     )     ->  Optional[int]:
      assert b != 0, "This cannot accept modulo that is == 0"
      if n == 0:
            return 1

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

      A    =				bin_exp_mod(lowerCAmelCase,    n / 2,    lowerCAmelCase     )
      return (r * r) % b


if __name__ == "__main__":
  try:
    _UpperCAmelCase    	=			int(input("Enter Base : ").strip())
    _UpperCAmelCase    	=			int(input("Enter Power : ").strip())
    _UpperCAmelCase    	=			int(input("Enter Modulo : ").strip())
  except ValueError:
    print("Invalid literal for integer")

  print(bin_exp_mod(BASE, POWER, MODULO))






from math import floor, sqrt


def 			__UpperCamelCase    (lowerCAmelCase					:  int     )     ->  int:
      A    =				0.0
      A    =				1.0
      A    =				int(sqrt(lowerCAmelCase     )     )
      A    =				root
      A    =				0
      while integer_part != 2 * root:
            A    =				denominator * integer_part - numerator
            A    =				(n - numerator**2) / denominator
            A    =				int((root + numerator) / denominator     )
            period += 1
      return period


def 			__UpperCamelCase    (lowerCAmelCase					:  int = 10_000     )     ->  int:
      A    =				0
      for i in range(2,    n + 1     ):
            A    =				sqrt(lowerCAmelCase     )
            if sr - floor(lowerCAmelCase     ) != 0 and continuous_fraction_period(lowerCAmelCase     ) % 2 == 1:
                  count_odd_periods += 1
      return count_odd_periods


if __name__ == "__main__":
  print(F'''{solution(int(input().strip()))}''')



