eolymp
bolt
Try our new interface for solving problems
Problems

Product of coprimes

Product of coprimes

You are given a positive integer \textbf{m}. Calculate the product of all positive integers less then or equal to \textbf{m} and coprime with \textbf{m}, and give the answer modulo \textbf{m}. \InputFile The only line of input file contains a positive integer \textbf{m} ≤ \textbf{10^18}. \OutputFile In the output file you should write the answer to the task.
Time limit 2 seconds
Memory limit 64 MiB
Input example #1
1
Output example #1
0
Author А.Лунев
Source Зимние сборы в Харькове 2010 День 1