


'''simple docstring'''





from __future__ import annotations


def 					a__    (				UpperCamelCase_	:			List[str]	):
   UpperCAmelCase__  :List[Any]            =			[0] * max_one

   for i in range(0,      lowerCamelCase__	):
      UpperCAmelCase__  :Union[str, Any]            =			i

   for i in range(2,      lowerCamelCase__	):
      if totients[i] == i:
         for j in range(lowerCamelCase__,      lowerCamelCase__,      lowerCamelCase__	):
            totients[j] -= totients[j] // i

   return totients


def 					a__    (				UpperCamelCase_	:			List[Any],      UpperCamelCase_	:			Tuple	):
   return sorted(str(lowerCamelCase__	)	) == sorted(str(lowerCamelCase__	)	)


def 					a__    (				UpperCamelCase_	:			Optional[Any] = 10_000_000	):
   UpperCAmelCase__  :str            =			1  # i
   UpperCAmelCase__  :Optional[Any]            =			0  # φ(i)
   UpperCAmelCase__  :Any            =			get_totients(max_n + 1	)

   for i in range(2,      max_n + 1	):
      UpperCAmelCase__  :str            =			totients[i]

      if i * min_denominator < min_numerator * t and has_same_digits(lowerCamelCase__,      lowerCamelCase__	):
         UpperCAmelCase__  :Tuple            =			i
         UpperCAmelCase__  :str            =			t

   return min_numerator


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







'''simple docstring'''





def 					a__    (				UpperCamelCase_	:			int = 100	):
   UpperCAmelCase__  :List[str]            =			1
   UpperCAmelCase__  :Dict            =			0
   for i in range(1,      num + 1	):
      fact *= i

   for j in str(UpperCamelCase_	):
      result += int(UpperCamelCase_	)

   return result


if __name__ == "__main__":
    print(solution(int(input('''Enter the Number: ''').strip())))



