Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/eng-katta-tub-boluvchi

Largest prime divisor

Medium 1000 ms 64 MB 50%
Share

A positive integer $n$ not less than $2$ is given. Find its largest prime divisor (for example, for $60 = 2^{2} \cdot 3 \cdot 5$ the largest is $5$; the largest prime divisor of a prime number is the number itself).

The prime factor tree of 60; the largest prime divisor is highlighted

Input

One positive integer $n$.

Output

One positive integer — the largest prime divisor.

Note

$2 \le n \le 10^{12}$

Examples

Input #1
60
Output #1
5
Input #2
13
Output #2
13

Sign in to submit a solution

Signing up is free and takes a minute.