#GYM104678I. Robin Hood

Robin Hood

Description

Robbers led by Robin Hood live in Sherwood Forest. They are extremely resentful that other people's incomes are distributed unevenly. Therefore, any of the robbers can approach two people and do the following actions:

1) Calculate how much money they have. Let these quantities be equal to $a_1$ and $a_2$.

2) Choose $i, j \in \{1;2\}$ $(i \neq j)$, also choose a prime number $p$ such that $a_i$ is divisible by $p$.

3) Redistribute the money so that one person has $\frac{a_i}{p}$ of money, and the other has $a_j*p$. If extra money remains from such a redistribution, then the robber will take it for himself. If, on the contrary, there is not enough money for such amounts, then the robber will pay them out of his own pocket.

Today two people will walk through Sherwood Forest with amounts of money equal to 1 and $n$. They can meet any non-negative number of robbers. The robbers, of course, plan to act together in order to take as much money as possible in total. How much richer can the robbers get?

The input contains one number $n$, $(1 \leq n \leq 10^9)$.

Print a single number - the amount of money the robbers can get if they act optimally.

Input

The input contains one number $n$, $(1 \leq n \leq 10^9)$.

Output

Print a single number - the amount of money the robbers can get if they act optimally.

8
29
3
0