P24428 [AtCoder] Factorial and Multiple
普及
题目描述

Problem Statement

You are given an integer K greater than or equal to 2.
Find the minimum positive integer N such that N! is a multiple of K.
Here, N! denotes the factorial of N. Under the Constraints of this problem, we can prove that such an N always exists.

Input

The input is given from Standard Input in the following format:
K

Output

Print the minimum positive integer N such that N! is a multiple of K.

Constraints

  • $2\leq K\leq 10^{12}$
  • K is an integer.

Sample Input 1

30

Sample Output 1

5

  • 1!=1
  • 2!$=2\times 1=2$
  • 3!$=3\times 2\times 1=6$
  • 4!$=4\times 3\times 2\times 1=24$
  • 5!$=5\times 4\times 3\times 2\times 1=120$

Therefore, 5 is the minimum positive integer N such that N! is a multiple of 30.
Thus, 5 should be printed.

Sample Input 2

123456789011

Sample Output 2

123456789011

Sample Input 3

280

Sample Output 3

7

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
30
样例输出
5