Product of coprimes#647

Product of coprimes

2 seconds
64 megabytes
Hard

You are given a positive integer . Calculate the product of all positive integers less than or equal to that are coprime with , and output the remainder when this product is divided by .

Input

The only line of the input file contains a positive integer (1 \leq m \leq 10^{18}).

Output

Output a single integer: the answer to the problem.

Examples

Example 1

Loading
Loading